1. 12 10月, 2011 3 次提交
  2. 13 8月, 2011 2 次提交
  3. 27 7月, 2011 1 次提交
  4. 26 7月, 2011 2 次提交
  5. 08 7月, 2011 4 次提交
    • C
      xfs: return the buffer locked from xfs_buf_get_uncached · c8da0faf
      Christoph Hellwig 提交于
      All other xfs_buf_get/read-like helpers return the buffer locked, make sure
      xfs_buf_get_uncached isn't different for no reason.  Half of the callers
      already lock it directly after, and the others probably should also keep
      it locked if only for consistency and beeing able to use xfs_buf_rele,
      but I'll leave that for later.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      c8da0faf
    • C
      xfs: split xfs_itruncate_finish · 8f04c47a
      Christoph Hellwig 提交于
      Split the guts of xfs_itruncate_finish that loop over the existing extents
      and calls xfs_bunmapi on them into a new helper, xfs_itruncate_externs.
      Make xfs_attr_inactive call it directly instead of xfs_itruncate_finish,
      which allows to simplify the latter a lot, by only letting it deal with
      the data fork.  As a result xfs_itruncate_finish is renamed to
      xfs_itruncate_data to make its use case more obvious.
      
      Also remove the sync parameter from xfs_itruncate_data, which has been
      unessecary since the introduction of the busy extent list in 2002, and
      completely dead code since 2003 when the XFS_BMAPI_ASYNC parameter was
      made a no-op.
      
      I can't actually see why the xfs_attr_inactive needs to set the transaction
      sync, but let's keep this patch simple and without changes in behaviour.
      
      Also avoid passing a useless argument to xfs_isize_check, and make it
      private to xfs_inode.c.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      8f04c47a
    • C
      xfs: kill xfs_itruncate_start · 857b9778
      Christoph Hellwig 提交于
      xfs_itruncate_start is a rather length wrapper that evaluates to a call
      to xfs_ioend_wait and xfs_tosspages, and only has two callers.
      
      Instead of using the complicated checks left over from IRIX where we
      can to truncate the pagecache just call xfs_tosspages
      (aka truncate_inode_pages) directly as we want to get rid of all data
      after i_size, and truncate_inode_pages handles incorrect alignments
      and too large offsets just fine.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      857b9778
    • C
      xfs: split xfs_setattr · c4ed4243
      Christoph Hellwig 提交于
      Split up xfs_setattr into two functions, one for the complex truncate
      handling, and one for the trivial attribute updates.  Also move both
      new routines to xfs_iops.c as they are fairly Linux-specific.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      c4ed4243
  6. 24 6月, 2011 1 次提交
    • D
      xfs: clear XFS_IDIRTY_RELEASE on truncate down · df4368a1
      Dave Chinner 提交于
      When an inode is truncated down, speculative preallocation is
      removed from the inode. This should also reset the state bits for
      controlling whether preallocation is subsequently removed when the
      file is next closed. The flag is not being cleared, so repeated
      operations on a file that first involve a truncate (e.g. multiple
      repeated dd invocations on a file) give different file layouts for
      the second and subsequent invocations.
      
      Fix this by clearing the XFS_IDIRTY_RELEASE state bit when the
      XFS_ITRUNCATED bit is detected in xfs_release() and hence ensure
      that speculative delalloc is removed on files that have been
      truncated down.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      df4368a1
  7. 31 3月, 2011 1 次提交
  8. 26 3月, 2011 1 次提交
  9. 07 3月, 2011 2 次提交
  10. 23 2月, 2011 1 次提交
  11. 23 12月, 2010 1 次提交
    • D
      xfs: don't truncate prealloc from frequently accessed inodes · 6e857567
      Dave Chinner 提交于
      A long standing problem for streaming writeѕ through the NFS server
      has been that the NFS server opens and closes file descriptors on an
      inode for every write. The result of this behaviour is that the
      ->release() function is called on every close and that results in
      XFS truncating speculative preallocation beyond the EOF.  This has
      an adverse effect on file layout when multiple files are being
      written at the same time - they interleave their extents and can
      result in severe fragmentation.
      
      To avoid this problem, keep track of ->release calls made on a dirty
      inode. For most cases, an inode is only going to be opened once for
      writing and then closed again during it's lifetime in cache. Hence
      if there are multiple ->release calls when the inode is dirty, there
      is a good chance that the inode is being accessed by the NFS server.
      Hence set a flag the first time ->release is called while there are
      delalloc blocks still outstanding on the inode.
      
      If this flag is set when ->release is next called, then do no
      truncate away the speculative preallocation - leave it there so that
      subsequent writes do not need to reallocate the delalloc space. This
      will prevent interleaving of extents of different inodes written
      concurrently to the same AG.
      
      If we get this wrong, it is not a big deal as we truncate
      speculative allocation beyond EOF anyway in xfs_inactive() when the
      inode is thrown out of the cache.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      6e857567
  12. 19 10月, 2010 6 次提交
    • A
      xfs: Extend project quotas to support 32bit project ids · 6743099c
      Arkadiusz Mi?kiewicz 提交于
      This patch adds support for 32bit project quota identifiers.
      
      On disk format is backward compatible with 16bit projid numbers. projid
      on disk is now kept in two 16bit values - di_projid_lo (which holds the
      same position as old 16bit projid value) and new di_projid_hi (takes
      existing padding) and converts from/to 32bit value on the fly.
      
      xfs_admin (for existing fs), mkfs.xfs (for new fs) needs to be used
      to enable PROJID32BIT support.
      Signed-off-by: NArkadiusz Miśkiewicz <arekm@maven.pl>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      6743099c
    • C
      xfs: remove xfs_buf wrappers · 1a1a3e97
      Christoph Hellwig 提交于
      Stop having two different names for many buffer functions and use
      the more descriptive xfs_buf_* names directly.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      1a1a3e97
    • C
      xfs: remove xfs_cred.h · 6c77b0ea
      Christoph Hellwig 提交于
      We're not actually passing around credentials inside XFS for a while
      now, so remove all xfs_cred.h with it's cred_t typedef and all
      instances of it.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      6c77b0ea
    • D
      xfs: rename xfs_buf_get_nodaddr to be more appropriate · 686865f7
      Dave Chinner 提交于
      xfs_buf_get_nodaddr() is really used to allocate a buffer that is
      uncached. While it is not directly assigned a disk address, the fact
      that they are not cached is a more important distinction. With the
      upcoming uncached buffer read primitive, we should be consistent
      with this disctinction.
      
      While there, make page allocation in xfs_buf_get_nodaddr() safe
      against memory reclaim re-entrancy into the filesystem by allowing
      a flags parameter to be passed.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      686865f7
    • D
      xfs: don't use vfs writeback for pure metadata modifications · dcd79a14
      Dave Chinner 提交于
      Under heavy multi-way parallel create workloads, the VFS struggles
      to write back all the inodes that have been changed in age order.
      The bdi flusher thread becomes CPU bound, spending 85% of it's time
      in the VFS code, mostly traversing the superblock dirty inode list
      to separate dirty inodes old enough to flush.
      
      We already keep an index of all metadata changes in age order - in
      the AIL - and continued log pressure will do age ordered writeback
      without any extra overhead at all. If there is no pressure on the
      log, the xfssyncd will periodically write back metadata in ascending
      disk address offset order so will be very efficient.
      
      Hence we can stop marking VFS inodes dirty during transaction commit
      or when changing timestamps during transactions. This will keep the
      inodes in the superblock dirty list to those containing data or
      unlogged metadata changes.
      
      However, the timstamp changes are slightly more complex than this -
      there are a couple of places that do unlogged updates of the
      timestamps, and the VFS need to be informed of these. Hence add a
      new function xfs_trans_ichgtime() for transactional changes,
      and leave xfs_ichgtime() for the non-transactional changes.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NAlex Elder <aelder@sgi.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      dcd79a14
    • D
      xfs: Introduce XFS_IOC_ZERO_RANGE · 44722352
      Dave Chinner 提交于
      XFS_IOC_ZERO_RANGE is the equivalent of an atomic XFS_IOC_UNRESVSP/
      XFS_IOC_RESVSP call pair. It enabled ranges of written data to be
      turned into zeroes without requiring IO or having to free and
      reallocate the extents in the range given as would occur if we had
      to punch and then preallocate them separately.  This enables
      applications to zero parts of files very quickly without changing
      the layout of the files in any way.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      44722352
  13. 03 9月, 2010 1 次提交
  14. 10 8月, 2010 1 次提交
    • 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
  15. 27 7月, 2010 6 次提交
  16. 24 6月, 2010 1 次提交
  17. 29 5月, 2010 1 次提交
    • D
      xfs: Check new inode size is OK before preallocating · 07f1a4f5
      Dave Chinner 提交于
      The new xfsqa test 228 tries to preallocate more space than the
      filesystem contains. it should fail, but instead triggers an assert
      about lock flags.  The failure is due to the size extension failing
      in vmtruncate() due to rlimit being set. Check this before we start
      the preallocation to avoid allocating space that will never be used.
      
      Also the path through xfs_vn_allocate already holds the IO lock, so
      it should not be present in the lock flags when the setattr fails.
      Hence the assert needs to take this into account. This will prevent
      other such callers from hitting this incorrect ASSERT.
      
      (Fixed a reference to "newsize" to read "new_size". -Alex)
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      07f1a4f5
  18. 02 3月, 2010 1 次提交
    • C
      xfs: remove wrapper for the fsync file operation · fd3200be
      Christoph Hellwig 提交于
      Currently the fsync file operation is divided into a low-level
      routine doing all the work and one that implements the Linux file
      operation and does minimal argument wrapping.  This is a leftover
      from the days of the vnode operations layer and can be removed to
      simplify the code a bit, as well as preparing for the implementation
      of an optimized fdatasync which needs to look at the Linux inode
      state.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAlex Elder <aelder@sgi.com>
      fd3200be
  19. 13 2月, 2010 1 次提交
  20. 02 2月, 2010 1 次提交
  21. 22 1月, 2010 2 次提交