1. 15 12月, 2009 1 次提交
  2. 09 10月, 2009 1 次提交
    • C
      xfs: implement ->dirty_inode to fix timestamp handling · f9581b14
      Christoph Hellwig 提交于
      This is picking up on Felix's repost of Dave's patch to implement a
      .dirty_inode method.  We really need this notification because
      the VFS keeps writing directly into the inode structure instead
      of going through methods to update this state.  In addition to
      the long-known atime issue we now also have a caller in VM code
      that updates c/mtime that way for shared writeable mmaps.  And
      I found another one that no one has noticed in practice in the FIFO
      code.
      
      So implement ->dirty_inode to set i_update_core whenever the
      inode gets externally dirtied, and switch the c/mtime handling to
      the same scheme we already use for atime (always picking up
      the value from the Linux inode).
      
      Note that this patch also removes the xfs_synchronize_atime call
      in xfs_reclaim it was superflous as we already synchronize the time
      when writing the inode via the log (xfs_inode_item_format) or the
      normal buffers (xfs_iflush_int).
      
      In addition also remove the I_CLEAR check before copying the Linux
      timestamps - now that we always have the Linux inode available
      we can always use the timestamps in it.
      
      Also switch to just using file_update_time for regular reads/writes -
      that will get us all optimization done to it for free and make
      sure we notice early when it breaks.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NFelix Blyakher <felixb@sgi.com>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      f9581b14
  3. 02 9月, 2009 2 次提交
    • C
      xfs: simplify xfs_trans_iget · aa72a5cf
      Christoph Hellwig 提交于
      xfs_trans_iget is a wrapper for xfs_iget that adds the inode to the
      transaction after it is read.  Except when the inode already is in the
      inode cache, in which case it returns the existing locked inode with
      increment lock recursion counts.
      
      Now, no one in the tree every decrements these lock recursion counts,
      so any user of this gets a potential double unlock when both the original
      owner of the inode and the xfs_trans_iget caller unlock it.  When looking
      back in a git bisect in the historic XFS tree there was only one place
      that decremented these counts, xfs_trans_iput.  Introduced in commit
      ca25df7a840f426eb566d52667b6950b92bb84b5 by Adam Sweeney in 1993,
      and removed in commit 19f899a3ab155ff6a49c0c79b06f2f61059afaf3 by
      Steve Lord in 2003.  And as long as it didn't slip through git bisects
      cracks never actually used in that time frame.
      
      A quick audit of the callers of xfs_trans_iget shows that no caller
      really relies on this behaviour fortunately - xfs_ialloc allows this
      inode from disk so it must not be there before, and all the RT allocator
      routines only every add each RT bitmap inode once.
      
      In addition to removing lots of code and reducing the size of the inode
      item this patch also avoids the double inode cache lookup in each
      create/mkdir/mknod transaction.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Signed-off-by: NFelix Blyakher <felixb@sgi.com>
      aa72a5cf
    • C
      xfs: merge fsync and O_SYNC handling · 13e6d5cd
      Christoph Hellwig 提交于
      The guarantees for O_SYNC are exactly the same as the ones we need to
      make for an fsync call (and given that Linux O_SYNC is O_DSYNC the
      equivalent is fdadatasync, but we treat both the same in XFS), except
      with a range data writeout.  Jan Kara has started unifying these two
      path for filesystems using the generic helpers, and I've started to
      look at XFS.
      
      The actual transaction commited by xfs_fsync and xfs_write_sync_logforce
      has a different transaction number, but actually is exactly the same.
      We'll only use the fsync transaction going forward.  One major difference
      is that xfs_write_sync_logforce never issues a cache flush unless we
      commit a transaction causing that as a side-effect, which is an obvious
      bug in the O_SYNC handling.  Second all the locking and i_update_size
      vs i_update_core changes from 978b7237
      never made it to xfs_write_sync_logforce, so we add them back.
      
      To make xfs_fsync easily usable from the O_SYNC path, the filemap_fdatawait
      call is moved up to xfs_file_fsync, so that we don't wait on the whole
      file after we already waited for our portion in xfs_write.
      
      We'll also use a plain call to filemap_write_and_wait_range instead
      of the previous sync_page_rang which did it in two steps including
      an half-hearted inode write out that doesn't help us.
      
      Once we're done with this also remove the now useless i_update_size
      tracking.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NFelix Blyakher <felixb@sgi.com>
      Signed-off-by: NFelix Blyakher <felixb@sgi.com>
      13e6d5cd
  4. 01 9月, 2009 1 次提交
  5. 08 8月, 2009 1 次提交
  6. 02 7月, 2009 1 次提交
  7. 24 6月, 2009 1 次提交
  8. 10 6月, 2009 1 次提交
  9. 29 3月, 2009 1 次提交
  10. 11 12月, 2008 1 次提交
    • C
      [XFS] resync headers with libxfs · 6d73cf13
      Christoph Hellwig 提交于
       - xfs_sb.h add the XFS_SB_VERSION2_PARENTBIT features2 that has been
         around in userspace for some time
       - xfs_inode.h: move a few things out of __KERNEL__ that are needed by
         userspace
       - xfs_mount.h: only include xfs_sync.h under __KERNEL__
       - xfs_inode.c: minor whitespace fixup.  I accidentaly changes this when
         importing this file for use by userspace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      6d73cf13
  11. 10 12月, 2008 1 次提交
  12. 04 12月, 2008 4 次提交
  13. 01 12月, 2008 8 次提交
  14. 14 11月, 2008 1 次提交
  15. 30 10月, 2008 11 次提交
  16. 13 8月, 2008 4 次提交
    • C
      [XFS] update timestamp in xfs_ialloc manually · dff35fd4
      Christoph Hellwig 提交于
      In xfs_ialloc we just want to set all timestamps to the current time. We
      don't need to mark the inode dirty like xfs_ichgtime does, and we don't
      need nor want the opimizations in xfs_ichgtime that I will introduce in
      the next patch.
      
      So just opencode the timestamp update in xfs_ialloc, and remove the new
      unused XFS_ICHGTIME_ACC case in xfs_ichgtime.
      
      SGI-PV: 981498
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31825a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      dff35fd4
    • D
      [XFS] replace inode flush semaphore with a completion · c63942d3
      David Chinner 提交于
      Use the new completion flush code to implement the inode flush lock.
      Removes one of the final users of semaphores in the XFS code base.
      
      SGI-PV: 981498
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31817a
      Signed-off-by: NDavid Chinner <david@fromorbit.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      c63942d3
    • C
      [XFS] kill bhv_vnode_t · 5ec7f8c7
      Christoph Hellwig 提交于
      All remaining bhv_vnode_t instance are in code that's more or less Linux
      specific. (Well, for xfs_acl.c that could be argued, but that code is on
      the removal list, too). So just do an s/bhv_vnode_t/struct inode/ over the
      whole tree. We can clean up variable naming and some useless helpers
      later.
      
      SGI-PV: 981498
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31781a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      5ec7f8c7
    • C
      [XFS] kill xfs_lock_dir_and_entry · e1cccd91
      Christoph Hellwig 提交于
      When multiple inodes are locked in XFS it happens in order of the inode
      number, with the everything but the first inode trylocked if any of the
      previous inodes is in the AIL.
      
      Except for the sorting of the inodes this logic is implemented in
      xfs_lock_inodes, but also partially duplicated in xfs_lock_dir_and_entry
      in a particularly stupid way adds a lock roundtrip if the inode ordering
      is not optimal.
      
      This patch adds a new helper xfs_lock_two_inodes that takes two inodes and
      locks them in the most optimal way according to the above locking protocol
      and uses it for all places that want to lock two inodes.
      
      The only caller of xfs_lock_inodes is xfs_rename which might lock up to
      four inodes.
      
      SGI-PV: 981498
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31772a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NDonald Douwsma <donaldd@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      e1cccd91