1. 10 6月, 2009 1 次提交
  2. 08 6月, 2009 1 次提交
    • C
      xfs: kill xfs_qmops · 7d095257
      Christoph Hellwig 提交于
      Kill the quota ops function vector and replace it with direct calls or
      stubs in the CONFIG_XFS_QUOTA=n case.
      
      Make sure we check XFS_IS_QUOTA_RUNNING in the right spots.  We can remove
      the number of those checks because the XFS_TRANS_DQ_DIRTY flag can't be set
      otherwise.
      
      This brings us back closer to the way this code worked in IRIX and earlier
      Linux versions, but we keep a lot of the more useful factoring of common
      code.
      
      Eventually we should also kill xfs_qm_bhv.c, but that's left for a later
      patch.
      
      Reduces the size of the source code by about 250 lines and the size of
      XFS module by about 1.5 kilobytes with quotas enabled:
      
         text	   data	    bss	    dec	    hex	filename
       615957	   2960	   3848	 622765	  980ad	fs/xfs/xfs.o
       617231	   3152	   3848	 624231	  98667	fs/xfs/xfs.o.old
      
      Fallout:
      
       - xfs_qm_dqattach is split into xfs_qm_dqattach_locked which expects
         the inode locked and xfs_qm_dqattach which does the locking around it,
         thus removing XFS_QMOPT_ILOCKED.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NEric Sandeen <sandeen@sandeen.net>
      7d095257
  3. 07 4月, 2009 3 次提交
    • D
      xfs: remove xfs_flush_space · 8de2bf93
      Dave Chinner 提交于
      The only thing we need to do now when we get an ENOSPC condition during delayed
      allocation reservation is flush all the other inodes with delalloc blocks on
      them and retry without EOF preallocation. Remove the unneeded mess that is
      xfs_flush_space() and just call xfs_flush_inodes() directly from
      xfs_iomap_write_delay().
      
      Also, change the location of the retry label to avoid trying to do EOF
      preallocation because we don't want to do that at ENOSPC. This enables us to
      remove the BMAPI_SYNC flag as it is no longer used.
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      8de2bf93
    • D
      xfs: make inode flush at ENOSPC synchronous · 5825294e
      Dave Chinner 提交于
      When we are writing to a single file and hit ENOSPC, we trigger a background
      flush of the inode and try again.  Because we hold page locks and the iolock,
      the flush won't proceed until after we release these locks. This occurs once
      we've given up and ENOSPC has been reported. Hence if this one is the only
      dirty inode in the system, we'll get an ENOSPC prematurely.
      
      To fix this, remove the async flush from the allocation routines and move
      it to the top of the write path where we can do a synchronous flush
      and retry the write again. Only retry once as a second ENOSPC indicates
      that we really are ENOSPC.
      
      This avoids a page cache deadlock when trying to do this flush synchronously
      in the allocation layer that was identified by Mikulas Patocka.
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      5825294e
    • D
      xfs: use xfs_sync_inodes() for device flushing · a8d770d9
      Dave Chinner 提交于
      Currently xfs_device_flush calls sync_blockdev() which is
      a no-op for XFS as all it's metadata is held in a different
      address to the one sync_blockdev() works on.
      
      Call xfs_sync_inodes() instead to flush all the delayed
      allocation blocks out. To do this as efficiently as possible,
      do it via two passes - one to do an async flush of all the
      dirty blocks and a second to wait for all the IO to complete.
      This requires some modification to the xfs-sync_inodes_ag()
      flush code to do efficiently.
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      a8d770d9
  4. 19 1月, 2009 1 次提交
  5. 16 1月, 2009 1 次提交
  6. 22 12月, 2008 1 次提交
    • L
      [XFS] Fix speculative allocation beyond eof · 9f6c92b9
      Lachlan McIlroy 提交于
      Speculative allocation beyond eof doesn't work properly.  It was
      broken some time ago after a code cleanup that moved what is now
      xfs_iomap_eof_align_last_fsb() and xfs_iomap_eof_want_preallocate()
      out of xfs_iomap_write_delay() into separate functions.  The code
      used to use the current file size in various checks but got changed
      to be max(file_size, i_new_size).  Since i_new_size is the result
      of 'offset + count' then in xfs_iomap_eof_want_preallocate() the
      check for '(offset + count) <= isize' will always be true.
      
      ie if 'offset + count' is > ip->i_size then isize will be i_new_size
      and equal to 'offset + count'.
      
      This change fixes all the places that used to use the current file
      size.
      Reviewed-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      9f6c92b9
  7. 28 7月, 2008 1 次提交
    • L
      [XFS] use minleft when allocating in xfs_bmbt_split() · 4ddd8bb1
      Lachlan McIlroy 提交于
      The bmap btree split code relies on a previous data extent allocation
      (from xfs_bmap_btalloc()) to find an AG that has sufficient space to
      perform a full btree split, when inserting the extent. When converting
      unwritten extents we don't allocate a data extent so a btree split will be
      the first allocation. In this case we need to set minleft so the allocator
      will pick an AG that has space to complete the split(s).
      
      SGI-PV: 983338
      
      SGI-Modid: xfs-linux-melb:xfs-kern:31357a
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      4ddd8bb1
  8. 29 4月, 2008 2 次提交
  9. 18 4月, 2008 1 次提交
  10. 07 2月, 2008 6 次提交
    • E
      [XFS] optimize XFS_IS_REALTIME_INODE w/o realtime config · 71ddabb9
      Eric Sandeen 提交于
      Use XFS_IS_REALTIME_INODE in more places, and #define it to 0 if
      CONFIG_XFS_RT is off. This should be safe because mount checks in
      xfs_rtmount_init:
      
      so if we get mounted w/o CONFIG_XFS_RT, no realtime inodes should be
      encountered after that.
      
      Defining XFS_IS_REALTIME_INODE to 0 saves a bit of stack space,
      presumeably gcc can optimize around the various "if (0)" type checks:
      
      xfs_alloc_file_space -8 xfs_bmap_adjacent -16 xfs_bmapi -8
      xfs_bmap_rtalloc -16 xfs_bunmapi -28 xfs_free_file_space -64 xfs_imap +8
      <-- ? hmm. xfs_iomap_write_direct -12 xfs_qm_dqusage_adjust -4
      xfs_qm_vop_chown_reserve -4
      
      SGI-PV: 971186
      SGI-Modid: xfs-linux-melb:xfs-kern:30014a
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      71ddabb9
    • D
      [XFS] Fix transaction overrun during writeback. · e4143a1c
      David Chinner 提交于
      Prevent transaction overrun in xfs_iomap_write_allocate() if we race with
      a truncate that overlaps the delalloc range we were planning to allocate.
      
      If we race, we may allocate into a hole and that requires block
      allocation. At this point in time we don't have a reservation for block
      allocation (apart from metadata blocks) and so allocating into a hole
      rather than a delalloc region results in overflowing the transaction block
      reservation.
      
      Fix it by only allowing a single extent to be allocated at a time.
      
      SGI-PV: 972757
      SGI-Modid: xfs-linux-melb:xfs-kern:30005a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      e4143a1c
    • C
      [XFS] kill xfs_iocore_t · 613d7043
      Christoph Hellwig 提交于
      xfs_iocore_t is a structure embedded in xfs_inode. Except for one field it
      just duplicates fields already in xfs_inode, and there is nothing this
      abstraction buys us on XFS/Linux. This patch removes it and shrinks source
      and binary size of xfs aswell as shrinking the size of xfs_inode by 60/44
      bytes in debug/non-debug builds.
      
      SGI-PV: 970852
      SGI-Modid: xfs-linux-melb:xfs-kern:29754a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      613d7043
    • L
      [XFS] kill unnessecary ioops indirection · 541d7d3c
      Lachlan McIlroy 提交于
      Currently there is an indirection called ioops in the XFS data I/O path.
      Various functions are called by functions pointers, but there is no
      coherence in what this is for, and of course for XFS itself it's entirely
      unused. This patch removes it instead and significantly reduces source and
      binary size of XFS while making maintaince easier.
      
      SGI-PV: 970841
      SGI-Modid: xfs-linux-melb:xfs-kern:29737a
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      541d7d3c
    • C
      [XFS] kill BMAPI_UNWRITTEN · 7642861b
      Christoph Hellwig 提交于
      There is no reason to go through xfs_iomap for the BMAPI_UNWRITTEN because
      it has nothing in common with the other cases. Instead check for the
      shutdown filesystem in xfs_end_bio_unwritten and perform a direct call to
      xfs_iomap_write_unwritten (which should be renamed to something more
      sensible one day)
      
      SGI-PV: 970241
      SGI-Modid: xfs-linux-melb:xfs-kern:29681a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NDonald Douwsma <donaldd@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      7642861b
    • C
      [XFS] kill BMAPI_DEVICE · 6214ed44
      Christoph Hellwig 提交于
      There is no reason to go into the iomap machinery just to get the right
      block device for an inode. Instead look at the realtime flag in the inode
      and grab the right device from the mount structure.
      
      I created a new helper, xfs_find_bdev_for_inode instead of opencoding it
      because I plan to use it in other places in the future.
      
      SGI-PV: 970240
      SGI-Modid: xfs-linux-melb:xfs-kern:29680a
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NDonald Douwsma <donaldd@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      6214ed44
  11. 16 10月, 2007 1 次提交
  12. 14 7月, 2007 2 次提交
    • D
      [XFS] Cleanup inode extent size hint extraction · 957d0ebe
      David Chinner 提交于
      SGI-PV: 966004
      SGI-Modid: xfs-linux-melb:xfs-kern:28866a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      957d0ebe
    • D
      [XFS] Prevent ENOSPC from aborting transactions that need to succeed · 84e1e99f
      David Chinner 提交于
      During delayed allocation extent conversion or unwritten extent
      conversion, we need to reserve some blocks for transactions reservations.
      We need to reserve these blocks in case a btree split occurs and we need
      to allocate some blocks.
      
      Unfortunately, we've only ever reserved the number of data blocks we are
      allocating, so in both the unwritten and delalloc case we can get ENOSPC
      to the transaction reservation. This is bad because in both cases we
      cannot report the failure to the writing application.
      
      The fix is two-fold:
      
      1 - leverage the reserved block infrastructure XFS already
      has to reserve a small pool of blocks by default to allow
      specially marked transactions to dip into when we are at
      ENOSPC.
      Default setting is min(5%, 1024 blocks).
      
      2 - convert critical transaction reservations to be allowed
      to dip into this pool. Spots changed are delalloc
      conversion, unwritten extent conversion and growing a
      filesystem at ENOSPC.
      This also allows growing the filesytsem to succeed at ENOSPC.
      
      SGI-PV: 964468
      SGI-Modid: xfs-linux-melb:xfs-kern:28865a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      84e1e99f
  13. 08 5月, 2007 2 次提交
    • L
      [XFS] Fix to prevent the notorious 'NULL files' problem after a crash. · ba87ea69
      Lachlan McIlroy 提交于
      The problem that has been addressed is that of synchronising updates of
      the file size with writes that extend a file. Without the fix the update
      of a file's size, as a result of a write beyond eof, is independent of
      when the cached data is flushed to disk. Often the file size update would
      be written to the filesystem log before the data is flushed to disk. When
      a system crashes between these two events and the filesystem log is
      replayed on mount the file's size will be set but since the contents never
      made it to disk the file is full of holes. If some of the cached data was
      flushed to disk then it may just be a section of the file at the end that
      has holes.
      
      There are existing fixes to help alleviate this problem, particularly in
      the case where a file has been truncated, that force cached data to be
      flushed to disk when the file is closed. If the system crashes while the
      file(s) are still open then this flushing will never occur.
      
      The fix that we have implemented is to introduce a second file size,
      called the in-memory file size, that represents the current file size as
      viewed by the user. The existing file size, called the on-disk file size,
      is the one that get's written to the filesystem log and we only update it
      when it is safe to do so. When we write to a file beyond eof we only
      update the in- memory file size in the write operation. Later when the I/O
      operation, that flushes the cached data to disk completes, an I/O
      completion routine will update the on-disk file size. The on-disk file
      size will be updated to the maximum offset of the I/O or to the value of
      the in-memory file size if the I/O includes eof.
      
      SGI-PV: 958522
      SGI-Modid: xfs-linux-melb:xfs-kern:28322a
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      ba87ea69
    • E
      [XFS] The last argument "lsn" of xfs_trans_commit() is always called with · 1c72bf90
      Eric Sandeen 提交于
      NULL.
      
      Patch provided by Eric Sandeen.
      
      SGI-PV: 961693
      SGI-Modid: xfs-linux-melb:xfs-kern:28199a
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NTim Shimmin <tes@sgi.com>
      1c72bf90
  14. 10 2月, 2007 2 次提交
  15. 28 9月, 2006 1 次提交
  16. 20 6月, 2006 1 次提交
  17. 09 6月, 2006 1 次提交
  18. 22 3月, 2006 1 次提交
  19. 11 1月, 2006 4 次提交
  20. 02 11月, 2005 4 次提交
  21. 05 9月, 2005 1 次提交
  22. 02 9月, 2005 1 次提交
  23. 21 6月, 2005 1 次提交