1. 10 8月, 2010 25 次提交
    • A
      switch hugetlbfs to ->evict_inode() · 2bbbda30
      Al Viro 提交于
      The first spoils - hugetlb can use default ->drop_inode() now.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2bbbda30
    • A
      New method - evict_inode() · be7ce416
      Al Viro 提交于
      Hybrid of ->clear_inode() and ->delete_inode(); if present, does
      all fs work to be done when in-core inode is about to be gone,
      for whatever reason.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      be7ce416
    • A
      unify fs/inode.c callers of clear_inode() · b4272d4c
      Al Viro 提交于
      For now, just a straightforward merge
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      b4272d4c
    • A
      simplify checks for I_CLEAR/I_FREEING · a4ffdde6
      Al Viro 提交于
      add I_CLEAR instead of replacing I_FREEING with it.  I_CLEAR is
      equivalent to I_FREEING for almost all code looking at either;
      it's there to keep track of having called clear_inode() exactly
      once per inode lifetime, at some point after having set I_FREEING.
      I_CLEAR and I_FREEING never get set at the same time with the
      current code, so we can switch to setting i_flags to I_FREEING | I_CLEAR
      instead of I_CLEAR without loss of information.  As the result of
      such change, checks become simpler and the amount of code that needs
      to know about I_CLEAR shrinks a lot.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      a4ffdde6
    • A
      get rid of file_fsync() · b5fc510c
      Al Viro 提交于
      Copy and simplify in the only two users remaining.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      b5fc510c
    • C
      xfs: new truncate sequence · fa9b227e
      Christoph Hellwig 提交于
      Convert XFS to the new truncate sequence.  We still can have errors after
      updating the file size in xfs_setattr, but these are real I/O errors and lead
      to a transaction abort and filesystem shutdown, so they are not an issue.
      
      Errors from ->write_begin and write_end can now be handled correctly because
      we can actually get rid of the delalloc extents while previous the buffer
      state was stipped in block_invalidatepage.
      
      There is still no error handling for ->direct_IO, because doing so will need
      some major restructuring given that we only have the iolock shared and do not
      hold i_mutex at all.  Fortunately leaving the normally allocated blocks behind
      there is not a major issue and this will get cleaned up by xfs_free_eofblock
      later.
      
      Note: the patch is against Al's vfs.git tree as that contains the nessecary
      preparations.  I'd prefer to get it applied there so that we can get some
      testing in linux-next.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      fa9b227e
    • B
      exofs: New truncate sequence · 2f246fd0
      Boaz Harrosh 提交于
      These changes are crafted based on the similar
      conversion done to ext2 by Nick Piggin.
      
      * Remove the deprecated ->truncate vector. Let exofs_setattr
        take care of on-disk size updates.
      * Call truncate_pagecache on the unused pages if
        write_begin/end fails.
      * Cleanup exofs_delete_inode that did stupid inode
        writes and updates on an inode that will be
        removed.
      * And finally get rid of exofs_get_block. We never
        had any blocks it was all for calling nobh_truncate_page.
        nobh_truncate_page is not actually needed in exofs since
        the last page is complete and gone, just like all the other
        pages. There is no partial blocks in exofs.
      
      I've tested with this patch, and there are no apparent
      failures, so far.
      
      CC: Nick Piggin <npiggin@suse.de>
      CC: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2f246fd0
    • A
      jffs2: don't open-code iget_failed() · 41cce647
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      41cce647
    • C
      1e231735
    • C
      check ATTR_SIZE contraints in inode_change_ok · 2c27c65e
      Christoph Hellwig 提交于
      Make sure we check the truncate constraints early on in ->setattr by adding
      those checks to inode_change_ok.  Also clean up and document inode_change_ok
      to make this obvious.
      
      As a fallout we don't have to call inode_newsize_ok from simple_setsize and
      simplify it down to a truncate_setsize which doesn't return an error.  This
      simplifies a lot of setattr implementations and means we use truncate_setsize
      almost everywhere.  Get rid of fat_setsize now that it's trivial and mark
      ext2_setsize static to make the calling convention obvious.
      
      Keep the inode_newsize_ok in vmtruncate for now as all callers need an
      audit for its removal anyway.
      
      Note: setattr code in ecryptfs doesn't call inode_change_ok at all and
      needs a deeper audit, but that is left for later.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2c27c65e
    • C
      always call inode_change_ok early in ->setattr · db78b877
      Christoph Hellwig 提交于
      Make sure we call inode_change_ok before doing any changes in ->setattr,
      and make sure to call it even if our fs wants to ignore normal UNIX
      permissions, but use the ATTR_FORCE to skip those.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      db78b877
    • C
      remove inode_setattr · 1025774c
      Christoph Hellwig 提交于
      Replace inode_setattr with opencoded variants of it in all callers.  This
      moves the remaining call to vmtruncate into the filesystem methods where it
      can be replaced with the proper truncate sequence.
      
      In a few cases it was obvious that we would never end up calling vmtruncate
      so it was left out in the opencoded variant:
      
       spufs: explicitly checks for ATTR_SIZE earlier
       btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
       ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above
      
      In addition to that ncpfs called inode_setattr with handcrafted iattrs,
      which allowed to trim down the opencoded variant.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1025774c
    • C
      default to simple_setattr · eef2380c
      Christoph Hellwig 提交于
      With the new truncate sequence every filesystem that wants to support file
      size changes on disk needs to implement its own ->setattr.  So instead
      of calling inode_setattr which supports size changes call into a simple
      method that doesn't support this.  simple_setattr is almost what we
      want except that it does not mark the inode dirty after changes.  Given
      that marking the inode dirty is a no-op for the simple in-memory filesystems
      that use simple_setattr currently just add the mark_inode_dirty call.
      
      Also add a WARN_ON for the presence of a truncate method to simple_setattr
      to catch new instances of it during the transition period.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      eef2380c
    • C
      rename generic_setattr · 6a1a90ad
      Christoph Hellwig 提交于
      Despite its name it's now a generic implementation of ->setattr, but
      rather a helper to copy attributes from a struct iattr to the inode.
      Rename it to setattr_copy to reflect this fact.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6a1a90ad
    • C
      add missing setattr methods · d39aae9e
      Christoph Hellwig 提交于
      For the new truncate sequence every filesystem that wants to truncate on-disk
      state needs a seattr method.  Convert the remaining filesystems that implement
      the truncate inode operation to have its own setattr method.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d39aae9e
    • C
      get rid of block_write_begin_newtrunc · 155130a4
      Christoph Hellwig 提交于
      Move the call to vmtruncate to get rid of accessive blocks to the callers
      in preparation of the new truncate sequence and rename the non-truncating
      version to block_write_begin.
      
      While we're at it also remove several unused arguments to block_write_begin.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      155130a4
    • C
      introduce __block_write_begin · 6e1db88d
      Christoph Hellwig 提交于
      Split up the block_write_begin implementation - __block_write_begin is a new
      trivial wrapper for block_prepare_write that always takes an already
      allocated page and can be either called from block_write_begin or filesystem
      code that already has a page allocated.  Remove the handling of already
      allocated pages from block_write_begin after switching all callers that
      do it to __block_write_begin.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6e1db88d
    • C
      clean up write_begin usage for directories in pagecache · f4e420dc
      Christoph Hellwig 提交于
      For filesystem that implement directories in pagecache we call
      block_write_begin with an already allocated page for this code, while the
      normal regular file write path uses the default block_write_begin behaviour.
      
      Get rid of the __foofs_write_begin helper and opencode the normal write_begin
      call in foofs_write_begin, while adding a new foofs_prepare_chunk helper for
      the directory code.  The added benefit is that foofs_prepare_chunk has
      a much saner calling convention.
      
      Note that the interruptible flag passed into block_write_begin is always
      ignored if we already pass in a page (see next patch for details), and
      we never were doing truncations of exessive blocks for this case either so we
      can switch directly to block_write_begin_newtrunc.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f4e420dc
    • C
      get rid of cont_write_begin_newtrunc · 282dc178
      Christoph Hellwig 提交于
      Move the call to vmtruncate to get rid of accessive blocks to the callers
      in preparation of the new truncate sequence and rename the non-truncating
      version to cont_write_begin.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      282dc178
    • C
      get rid of nobh_write_begin_newtrunc · ea0f04e5
      Christoph Hellwig 提交于
      Move the call to vmtruncate to get rid of accessive blocks to the only
      remaining caller and rename the non-truncating version to nobh_write_begin.
      
      Get rid of the superflous file argument to it while we're at it.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      ea0f04e5
    • C
      sort out blockdev_direct_IO variants · eafdc7d1
      Christoph Hellwig 提交于
      Move the call to vmtruncate to get rid of accessive blocks to the callers
      in prepearation of the new truncate calling sequence.  This was only done
      for DIO_LOCKING filesystems, so the __blockdev_direct_IO_newtrunc variant
      was not needed anyway.  Get rid of blockdev_direct_IO_no_locking and
      its _newtrunc variant while at it as just opencoding the two additional
      paramters is shorted than the name suffix.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      eafdc7d1
    • A
      fix leak in __logfs_create() · 25624958
      Al Viro 提交于
      if kmalloc fails, we still need to drop the inode, as we do
      on other failure exits.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      25624958
    • A
      Fix reiserfs_file_release() · 0e4f6a79
      Al Viro 提交于
      a) count file openers correctly; i_count use was completely wrong
      b) use new mutex for exclusion between final close/open/truncate,
      to protect tailpacking logics.  i_mutex use was wrong and resulted
      in deadlocks.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0e4f6a79
    • A
      missing include in hppfs · 918377b6
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      918377b6
    • A
      Deal with missing exports for hostfs · 005a59ec
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      005a59ec
  2. 04 8月, 2010 4 次提交
    • L
      Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs · 51102ee5
      Linus Torvalds 提交于
      * 'for-linus' of git://oss.sgi.com/xfs/xfs: (49 commits)
        xfs simplify and speed up direct I/O completions
        xfs: move aio completion after unwritten extent conversion
        direct-io: move aio_complete into ->end_io
        xfs: fix big endian build
        xfs: clean up xfs_bmap_get_bp
        xfs: simplify xfs_truncate_file
        xfs: kill the b_strat callback in xfs_buf
        xfs: remove obsolete osyncisosync mount option
        xfs: clean up filestreams helpers
        xfs: fix gcc 4.6 set but not read and unused statement warnings
        xfs: Fix build when CONFIG_XFS_POSIX_ACL=n
        xfs: fix unsigned underflow in xfs_free_eofblocks
        xfs: use GFP_NOFS for page cache allocation
        xfs: fix memory reclaim recursion deadlock on locked inode buffer
        xfs: fix xfs_trans_add_item() lockdep warnings
        xfs: simplify and remove xfs_ireclaim
        xfs: don't block on buffer read errors
        xfs: move inode shrinker unregister even earlier
        xfs: remove a dmapi leftover
        xfs: writepage always has buffers
        ...
      51102ee5
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 · 54161df1
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (29 commits)
        cifs: fsc should not default to "on"
        [CIFS] remove redundant path walking in dfs_do_refmount
        cifs: ignore the "mand", "nomand" and "_netdev" mount options
        cifs: map NT_STATUS_ERROR_WRITE_PROTECTED to -EROFS
        cifs: don't allow cifs_iget to match inodes of the wrong type
        [CIFS] relinquish fscache cookie before freeing CIFSTconInfo
        cifs: add separate cred_uid field to sesInfo
        fs: cifs: check kmalloc() result
        [CIFS] Missing ifdef
        [CIFS] Missing line from previous commit
        [CIFS] Fix build break when CONFIG_CIFS_FSCACHE disabled
        cifs: add mount option to enable local caching
        cifs: read pages from FS-Cache
        cifs: store pages into local cache
        cifs: FS-Cache page management
        cifs: define inode-level cache object and register them
        cifs: define superblock-level cache index objects and register them
        cifs: remove unused cifsUidInfo struct
        cifs: clean up cifs_find_smb_ses (try #2)
        cifs: match secType when searching for existing tcp session
        ...
      54161df1
    • L
      Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm · be82ae02
      Linus Torvalds 提交于
      * 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (291 commits)
        ARM: AMBA: Add pclk support to AMBA bus infrastructure
        ARM: 6278/2: fix regression in RealView after the introduction of pclk
        ARM: 6277/1: mach-shmobile: Allow users to select HZ, default to 128
        ARM: 6276/1: mach-shmobile: remove duplicate NR_IRQS_LEGACY
        ARM: 6246/1: mmci: support larger MMCIDATALENGTH register
        ARM: 6245/1: mmci: enable hardware flow control on Ux500 variants
        ARM: 6244/1: mmci: add variant data and default MCICLOCK support
        ARM: 6243/1: mmci: pass power_mode to the translate_vdd callback
        ARM: 6274/1: add global control registers definition header file for nuc900
        mx2_camera: fix type of dma buffer virtual address pointer
        mx2_camera: Add soc_camera support for i.MX25/i.MX27
        arm/imx/gpio: add spinlock protection
        ARM: Add support for the LPC32XX arch
        ARM: LPC32XX: Arch config menu supoport and makefiles
        ARM: LPC32XX: Phytec 3250 platform support
        ARM: LPC32XX: Misc support functions
        ARM: LPC32XX: Serial support code
        ARM: LPC32XX: System suspend support
        ARM: LPC32XX: GPIO, timer, and IRQ drivers
        ARM: LPC32XX: Clock driver
        ...
      be82ae02
    • H
      PARISC: led.c - fix potential stack overflow in led_proc_write() · 4b4fd27c
      Helge Deller 提交于
      avoid potential stack overflow by correctly checking count parameter
      Reported-by: NIlja <ilja@netric.org>
      Signed-off-by: NHelge Deller <deller@gmx.de>
      Acked-by: NKyle McMartin <kyle@mcmartin.ca>
      Cc: James E.J. Bottomley <jejb@parisc-linux.org>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4b4fd27c
  3. 02 8月, 2010 11 次提交