xfs
[Top] [All Lists]

[XFS updates] XFS development tree branch, for-linus, updated. v3.1-rc3-

To: xfs@xxxxxxxxxxx
Subject: [XFS updates] XFS development tree branch, for-linus, updated. v3.1-rc3-1242-g9e4c109
From: xfs@xxxxxxxxxxx
Date: Thu, 27 Oct 2011 11:58:07 -0500
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "XFS development tree".

The branch, for-linus has been updated
  discards  8e749e30958c1e592b4001a4a186d2b133df0aa0 (commit)
  9e4c109 xfs: add AIL pushing tracepoints
  2900b33 xfs: put in missed fix for merge problem
  9508534 Merge branch 'master' of 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
  5a93a06 xfs: do not flush data workqueues in xfs_flush_buftarg
  a9add83 xfs: remove XFS_bflush
  02b102d xfs: remove xfs_buf_target_name
  b38505b xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks
  901796a xfs: clean up xfs_ioerror_alert
  4347b9d xfs: clean up buffer allocation
  af5c4be xfs: remove buffers from the delwri list in xfs_buf_stale
  c867cb6 xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE
  38f2323 xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF
  5fde032 xfs: remove XFS_BUF_FINISH_IOWAIT
  b17b833 xfs: remove xfs_get_buftarg_list
  87c7bec xfs: fix buffer flushing during unmount
  1da2f2d xfs: optimize fsync on directories
  670ce93 xfs: reduce the number of log forces from tail pushing
  3815832 xfs: Don't allocate new buffers on every call to _xfs_buf_find
  ddc3415 xfs: simplify xfs_trans_ijoin* again
  23bb0be xfs: unlock the inode before log force in xfs_change_file_space
  8292d88 xfs: unlock the inode before log force in xfs_fs_nfs_commit_metadata
  b103705 xfs: unlock the inode before log force in xfs_fsync
  815cb21 xfs: XFS_TRANS_SWAPEXT is not a valid flag for xfs_trans_commit
  c029a50 xfs: fix possible overflow in xfs_ioc_trim()
  d952e2f xfs: cleanup xfs_bmap.h
  b0eab14 xfs: dont ignore error code from xfs_bmbt_update
  c653424 xfs: pass bmalloca to xfs_bmap_add_extent_hole_real
  572a4cf xfs: pass bmalloca to xfs_bmap_add_extent_delay_real
  c315c90 xfs: move logflags into bmalloca
  e0c3da5 xfs: move lastx and nallocs into bmalloca
  29c8d17 xfs: move btree cursor into bmalloca
  963c30c xfs: do not keep local copies of allocation ranges in 
xfs_bmapi_allocate
  3a75667 xfs: rename allocation range fields in struct xfs_bmalloca
  0937e0f xfs: move firstblock and bmap freelist cursor into bmalloca structure
  baf41a5 xfs: move extent records into bmalloca structure
  1b16447 xfs: pass bmalloca structure to xfs_bmap_isaeof
  a5bd606 xfs: remove xfs_bmap_add_extent
  27a3f8f xfs: introduce xfs_bmap_last_extent
  c0dc782 xfs: rename xfs_bmapi to xfs_bmapi_write
  b447fe5 xfs: factor unwritten extent map manipulations out of xfs_bmapi
  7e47a4e xfs: factor extent allocation out of xfs_bmapi
  1fd044d xfs: do not use xfs_bmap_add_extent for adding delalloc extents
  4403280 xfs: introduce xfs_bmapi_delay()
  b64dfe4 xfs: factor delalloc reservations out of xfs_bmapi
  5b777ad xfs: remove xfs_bmapi_single()
  5c8ed20 xfs: introduce xfs_bmapi_read()
  aef9a89 xfs: factor extent map manipulations out of xfs_bmapi
  ecee76b xfs: remove the nextents variable in xfs_bmapi
  b9b984d xfs: remove impossible to read code in xfs_bmap_add_extent_delay_real
  e7455e0 xfs: remove the first extent special case in xfs_bmap_add_extent
  ed32201 xfs: Return -EIO when xfs_vn_getattr() failed
  eabbaf1 xfs: Fix the incorrect comment in the header of _xfs_buf_find
  2a30f36d xfs: Check the return value of xfs_trans_get_buf()
  b522950 xfs: Check the return value of xfs_buf_get()
  04f658e xfs: improve ioend error handling
  c58cb16 xfs: avoid direct I/O write vs buffered I/O race
  859f57c xfs: avoid synchronous transactions when deleting attr blocks
  4a06fd2 xfs: remove i_iocount
  2b3ffd7 xfs: wait for I/O completion when writing out pages in 
xfs_setattr_size
  fc0063c xfs: reduce ioend latency
  c859cdd xfs: defer AIO/DIO completions
  398d25e xfs: remove dead ENODEV handling in xfs_destroy_ioend
  c4e1c09 xfs: use the "delwri" terminology consistently
  c2b006c xfs: let xfs_bwrite callers handle the xfs_buf_relse
  61551f1 xfs: call xfs_buf_delwri_queue directly
  5a8ee6b xfs: move more delwri setup into xfs_buf_delwri_queue
  527cfdf xfs: remove the unlock argument to xfs_buf_delwri_queue
  375ec69 xfs: remove delwri buffer handling from xfs_buf_iorequest
  7271d24 xfs: don't serialise adjacent concurrent direct IO appending writes
  0c38a25 xfs: don't serialise direct IO reads on page cache checks
      from  8e749e30958c1e592b4001a4a186d2b133df0aa0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9e4c109ac822395e0aae650e4e3c9e4903f6602f
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Oct 11 15:14:11 2011 +0000

    xfs: add AIL pushing tracepoints
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 2900b33999e2fc8a8edf0dddaafffec4da25ee10
Author: Alex Elder <aelder@xxxxxxx>
Date:   Tue Oct 18 20:00:14 2011 +0000

    xfs: put in missed fix for merge problem
    
    I intended to do this as part of fixing part of the conflict with
    the merge with Linus' tree, but evidently it didn't get included in
    the commit.
    
    Signed-off-by: Alex Elder <aelder@xxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>

commit 9508534c5f170ada5a745cde0df49732718440e9
Merge: 5a93a064d27b42e4af1772b0599b53e3241191ac 
a84a79e4d369a73c0130b5858199e949432da4c6
Author: Alex Elder <aelder@xxxxxxx>
Date:   Mon Oct 17 15:42:02 2011 -0500

    Merge branch 'master' of 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
    
    Resolved conflicts:
      fs/xfs/xfs_trans_priv.h:
        - deleted struct xfs_ail field xa_flags
        - kept field xa_log_flush in struct xfs_ail
      fs/xfs/xfs_trans_ail.c:
        - in xfsaild_push(), in XFS_ITEM_PUSHBUF case, replaced
          "flush_log = 1" with "ailp->xa_log_flush++"
    
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 5a93a064d27b42e4af1772b0599b53e3241191ac
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:53 2011 +0000

    xfs: do not flush data workqueues in xfs_flush_buftarg
    
    When we call xfs_flush_buftarg (generally from sync or umount) it already
    is too late to flush the data workqueues, as I/O completion is signalled
    for them and we are thus already done with the data we would flush here.
    
    There are places where flushing them might be useful, but the current
    sync interface doesn't give us that opportunity.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit a9add83e5abd29bf2b7b3658311199eeabbdefc6
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:52 2011 +0000

    xfs: remove XFS_bflush
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 02b102df1502a7ea4167d115510e1e8fe6467f12
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:51 2011 +0000

    xfs: remove xfs_buf_target_name
    
    The calling convention that returns a pointer to a static buffer is
    fairly nasty, so just opencode it in the only caller that is left.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit b38505b09b7854d446b2f60b4414e3231277aa1a
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:50 2011 +0000

    xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks
    
    Use xfs_ioerror_alert instead of opencoding a very similar error
    message.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 901796afca0d31d97bf6d1bf2ab251a93a4b8c83
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:49 2011 +0000

    xfs: clean up xfs_ioerror_alert
    
    Instead of passing the block number and mount structure explicitly
    get them off the bp and fix make the argument order more natural.
    
    Also move it to xfs_buf.c and stop printing the device name given
    that we already get the fs name as part of xfs_alert, and we know
    what device is operates on because of the caller that gets printed,
    finally rename it to xfs_buf_ioerror_alert and pass __func__ as
    argument where it makes sense.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 4347b9d7ad4223474d315c3ab6bc1ce7cce7fa2d
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:48 2011 +0000

    xfs: clean up buffer allocation
    
    Change _xfs_buf_initialize to allocate the buffer directly and rename it to
    xfs_buf_alloc now that is the only buffer allocation routine.  Also remove
    the xfs_buf_deallocate wrapper around the kmem_zone_free calls for buffers.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit af5c4bee499eb68bc36ca046030394d82d0e3669
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:47 2011 +0000

    xfs: remove buffers from the delwri list in xfs_buf_stale
    
    For each call to xfs_buf_stale we call xfs_buf_delwri_dequeue either
    directly before or after it, or are guaranteed by the surrounding
    conditionals that we are never called on delwri buffers.  Simply
    this situation by moving the call to xfs_buf_delwri_dequeue into
    xfs_buf_stale.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c867cb61641751fd3d86350232d64ae2a10137d4
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:46 2011 +0000

    xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 38f23232449c9d2c0bc8e9541cb8ab08b7c2b9ce
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:45 2011 +0000

    xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 5fde0326ddb1472ef31034c8ed952a19d4679191
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:44 2011 +0000

    xfs: remove XFS_BUF_FINISH_IOWAIT
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit b17b833443a3b65907f5ecb36f8af33996f6ec78
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Oct 10 16:52:43 2011 +0000

    xfs: remove xfs_get_buftarg_list
    
    The code is unused and under a config option that doesn't exist, remove it.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 87c7bec7fc3377b3873eb3a0f4b603981ea16ebb
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Wed Sep 14 14:08:26 2011 +0000

    xfs: fix buffer flushing during unmount
    
    The code to flush buffers in the umount code is a bit iffy: we first
    flush all delwri buffers out, but then might be able to queue up a
    new one when logging the sb counts.  On a normal shutdown that one
    would get flushed out when doing the synchronous superblock write in
    xfs_unmountfs_writesb, but we skip that one if the filesystem has
    been shut down.
    
    Fix this by moving the delwri list flushing until just before unmounting
    the log, and while we're at it also remove the superflous delwri list
    and buffer lru flusing for the rt and log device that can never have
    cached or delwri buffers.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reported-by: Amit Sahrawat <amit.sahrawat83@xxxxxxxxx>
    Tested-by: Amit Sahrawat <amit.sahrawat83@xxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 1da2f2dbf2d2aaa1b0f6ca2f61fcf07e24eb659b
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Oct 2 14:25:16 2011 +0000

    xfs: optimize fsync on directories
    
    Directories are only updated transactionally, which means fsync only
    needs to flush the log the inode is currently dirty, but not bother
    with checking for dirty data, non-transactional updates, and most
    importanly doesn't have to flush disk caches except as part of a
    transaction commit.
    
    While the first two optimizations can't easily be measured, the
    latter actually makes a difference when doing lots of fsync that do
    not actually have to commit the inode, e.g. because an earlier fsync
    already pushed the log far enough.
    
    The new xfs_dir_fsync is identical to xfs_nfs_commit_metadata except
    for the prototype, but I'm not sure creating a common helper for the
    two is worth it given how simple the functions are.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 670ce93fef93bba8c8a422a79747385bec8e846a
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Fri Sep 30 04:45:03 2011 +0000

    xfs: reduce the number of log forces from tail pushing
    
    The AIL push code will issue a log force on ever single push loop
    that it exits and has encountered pinned items. It doesn't rescan
    these pinned items until it revisits the AIL from the start. Hence
    we only need to force the log once per walk from the start of the
    AIL to the target LSN.
    
    This results in numbers like this:
    
        xs_push_ail_flush.....         1456
        xs_log_force.........          1485
    
    For an 8-way 50M inode create workload - almost all the log forces
    are coming from the AIL pushing code.
    
    Reduce the number of log forces by only forcing the log if the
    previous walk found pinned buffers. This reduces the numbers to:
    
        xs_push_ail_flush.....          665
        xs_log_force.........           682
    
    For the same test.
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 3815832a2aa4df9815d15dac05227e0c8551833f
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Fri Sep 30 04:45:02 2011 +0000

    xfs: Don't allocate new buffers on every call to _xfs_buf_find
    
    Stats show that for an 8-way unlink @ ~80,000 unlinks/s we are doing
    ~1 million cache hit lookups to ~3000 buffer creates. That's almost
    3 orders of magnitude more cahce hits than misses, so optimising for
    cache hits is quite important. In the cache hit case, we do not need
    to allocate a new buffer in case of a cache miss, so we are
    effectively hitting the allocator for no good reason for vast the
    majority of calls to _xfs_buf_find. 8-way create workloads are
    showing similar cache hit/miss ratios.
    
    The result is profiles that look like this:
    
         samples  pcnt function                        DSO
         _______ _____ _______________________________ _________________
    
         1036.00 10.0% _xfs_buf_find                   [kernel.kallsyms]
          582.00  5.6% kmem_cache_alloc                [kernel.kallsyms]
          519.00  5.0% __memcpy                        [kernel.kallsyms]
          468.00  4.5% __ticket_spin_lock              [kernel.kallsyms]
          388.00  3.7% kmem_cache_free                 [kernel.kallsyms]
          331.00  3.2% xfs_log_commit_cil              [kernel.kallsyms]
    
    
    Further, there is a fair bit of work involved in initialising a new
    buffer once a cache miss has occurred and we currently do that under
    the rbtree spinlock. That increases spinlock hold time on what are
    heavily used trees.
    
    To fix this, remove the initialisation of the buffer from
    _xfs_buf_find() and only allocate the new buffer once we've had a
    cache miss. Initialise the buffer immediately after allocating it in
    xfs_buf_get, too, so that is it ready for insert if we get another
    cache miss after allocation. This minimises lock hold time and
    avoids unnecessary allocator churn. The resulting profiles look
    like:
    
         samples  pcnt function                    DSO
         _______ _____ ___________________________ _________________
    
         8111.00  9.1% _xfs_buf_find               [kernel.kallsyms]
         4380.00  4.9% __memcpy                    [kernel.kallsyms]
         4341.00  4.8% __ticket_spin_lock          [kernel.kallsyms]
         3401.00  3.8% kmem_cache_alloc            [kernel.kallsyms]
         2856.00  3.2% xfs_log_commit_cil          [kernel.kallsyms]
         2625.00  2.9% __kmalloc                   [kernel.kallsyms]
         2380.00  2.7% kfree                       [kernel.kallsyms]
         2016.00  2.3% kmem_cache_free             [kernel.kallsyms]
    
    Showing a significant reduction in time spent doing allocation and
    freeing from slabs (kmem_cache_alloc and kmem_cache_free).
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit ddc3415aba1cb2f86d1fcad720cea834ee178f54
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Sep 19 15:00:54 2011 +0000

    xfs: simplify xfs_trans_ijoin* again
    
    There is no reason to keep a reference to the inode even if we unlock
    it during transaction commit because we never drop a reference between
    the ijoin and commit.  Also use this fact to merge xfs_trans_ijoin_ref
    back into xfs_trans_ijoin - the third argument decides if an unlock
    is needed now.
    
    I'm actually starting to wonder if allowing inodes to be unlocked
    at transaction commit really is worth the effort.  The only real
    benefit is that they can be unlocked earlier when commiting a
    synchronous transactions, but that could be solved by doing the
    log force manually after the unlock, too.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 23bb0be1a237c8732ce1a43140e5cb103a676b92
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:47:51 2011 +0000

    xfs: unlock the inode before log force in xfs_change_file_space
    
    Let the transaction commit unlock the inode before it potentially causes
    a synchronous log force.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 8292d88c5c833fc8b837c3a018fd6d72c35a3231
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:47:50 2011 +0000

    xfs: unlock the inode before log force in xfs_fs_nfs_commit_metadata
    
    Only read the LSN we need to push to with the ilock held, and then release
    it before we do the log force to improve concurrency.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit b10370585349d364ff3c550afa7922e6e21f029d
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Sep 19 14:55:51 2011 +0000

    xfs: unlock the inode before log force in xfs_fsync
    
    Only read the LSN we need to push to with the ilock held, and then release
    it before we do the log force to improve concurrency.
    
    This also removes the only direct caller of _xfs_trans_commit, thus
    allowing it to be merged into the plain xfs_trans_commit again.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 815cb21662b914e1e14c256a3d662b1352c8509e
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Mon Sep 26 09:14:34 2011 +0000

    xfs: XFS_TRANS_SWAPEXT is not a valid flag for xfs_trans_commit
    
    XFS_TRANS_SWAPEXT is a transaction type, not a flag for xfs_trans_commit, so
    don't pass it in xfs_swap_extents.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c029a50d51b8a9520105ec903639de03389915d0
Author: Lukas Czerner <lczerner@xxxxxxxxxx>
Date:   Wed Sep 21 09:42:30 2011 +0000

    xfs: fix possible overflow in xfs_ioc_trim()
    
    In xfs_ioc_trim it is possible that computing the last allocation group
    to discard might overflow for big start & len values, because the result
    might be bigger then xfs_agnumber_t which is 32 bit long. Fix this by not
    allowing the start and end block of the range to be beyond the end of the
    file system.
    
    Note that if the start is beyond the end of the file system we have to
    return -EINVAL, but in the "end" case we have to truncate it to the fs
    size.
    
    Also introduce "end" variable, rather than using start+len which which
    might be more confusing to get right as this bug shows.
    
    Signed-off-by: Lukas Czerner <lczerner@xxxxxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit d952e2f81244d6502aff126df5011fab10f92187
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:41:07 2011 +0000

    xfs: cleanup xfs_bmap.h
    
    Convert all function prototypes to the short form used elsewhere,
    and remove duplicates of comments already placed at the function
    body.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit b0eab14e74d2d7b22d065e18a1cdebcf7716debf
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:41:06 2011 +0000

    xfs: dont ignore error code from xfs_bmbt_update
    
    Fix a case in xfs_bmap_add_extent_unwritten_real where we aren't
    passing the returned error on.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c6534249851d062113ab4d8d226be8dba8ecb92e
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:41:05 2011 +0000

    xfs: pass bmalloca to xfs_bmap_add_extent_hole_real
    
    All the parameters passed to xfs_bmap_add_extent_hole_real() are in
    the xfs_bmalloca structure now. Just pass the bmalloca parameter to
    the function instead of 8 separate parameters.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 572a4cf04ac7f46e9206aabfef03dae602812341
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:41:04 2011 +0000

    xfs: pass bmalloca to xfs_bmap_add_extent_delay_real
    
    All the parameters passed to xfs_bmap_add_extent_delay_real() are in
    the xfs_bmalloca structure now. Just pass the bmalloca parameter to
    the function instead of 8 separate parameters.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c315c90b7d530d1ec3c226052e153b0cffa512c8
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:41:02 2011 +0000

    xfs: move logflags into bmalloca
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit e0c3da5d89dc1aeef2275a8b751231e147603f0f
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:41:01 2011 +0000

    xfs: move lastx and nallocs into bmalloca
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 29c8d17a8938be88e36b93522753f3519aefd05d
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:41:00 2011 +0000

    xfs: move btree cursor into bmalloca
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 963c30cf45e8c832ae11438ff9d99c954b9d0114
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:59 2011 +0000

    xfs: do not keep local copies of allocation ranges in xfs_bmapi_allocate
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 3a75667e902dbdb87718b1ee2b3b745b344a8163
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:58 2011 +0000

    xfs: rename allocation range fields in struct xfs_bmalloca
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 0937e0fd8be6f9c26844127d39d677bb752e8741
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:57 2011 +0000

    xfs: move firstblock and bmap freelist cursor into bmalloca structure
    
    Rather than passing the firstblock and freelist structure around,
    embed it into the bmalloca structure and remove it from the function
    parameters.
    
    This also enables the minleft parameter to be set only once in
    xfs_bmapi_write(), and the freelist cursor directly queried in
    xfs_bmapi_allocate to clear it when the lowspace algorithm is
    activated.
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit baf41a52b9c62f9a825371806129ed12e2c1e2d8
Author: Dave Chinner <david@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:56 2011 +0000

    xfs: move extent records into bmalloca structure
    
    Rather that putting extent records on the stack and then pointing to
    them in the bmalloca structure which is in the same stack frame, put
    the extent records directly in the bmalloca structure. This reduces
    the number of args that need to be passed around.
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 1b16447ba24ae39c7fe7133fcdcb4f174dec1901
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:55 2011 +0000

    xfs: pass bmalloca structure to xfs_bmap_isaeof
    
    All the variables xfs_bmap_isaeof() is passed are contained within
    the xfs_bmalloca structure. Pass that instead.
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit a5bd606ba65f24e5990edfc0e7b52702720ee6fa
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:54 2011 +0000

    xfs: remove xfs_bmap_add_extent
    
    There is no real need to the xfs_bmap_add_extent, as the callers
    know what kind of extents they need to it.  Removing it means
    duplicating the extents to btree conversion logic in three places,
    but overall it's still much simpler code and quite a bit less code.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 27a3f8f2de758205765f277b3428bbf3d15da973
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:53 2011 +0000

    xfs: introduce xfs_bmap_last_extent
    
    Add a common helper for finding the last extent in a file.
    
    Largely based on a patch from Dave Chinner.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c0dc7828af6952643219292be29e482ef74cb261
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:52 2011 +0000

    xfs: rename xfs_bmapi to xfs_bmapi_write
    
    Now that all the read-only users of xfs_bmapi have been converted to
    use xfs_bmapi_read(), we can remove all the read-only handling cases
    from xfs_bmapi().
    
    Once this is done, rename xfs_bmapi to xfs_bmapi_write to reflect
    the fact it is for allocation only. This enables us to kill the
    XFS_BMAPI_WRITE flag as well.
    
    Also clean up xfs_bmapi_write to the style used in the newly added
    xfs_bmapi_read/delay functions.
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit b447fe5a05cbd01c4bf7fe2fa41cb9e99ce7e58e
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:51 2011 +0000

    xfs: factor unwritten extent map manipulations out of xfs_bmapi
    
    To further improve the readability of xfs_bmapi(), factor the
    unwritten extent conversion out into a separate function. This
    removes large block of logic from the xfs_bmapi() code loop and
    makes it easier to see the operational logic flow for xfs_bmapi().
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 7e47a4efde33aa3f0cb901e086a75751c2269f04
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:50 2011 +0000

    xfs: factor extent allocation out of xfs_bmapi
    
    To further improve the readability of xfs_bmapi(), factor the extent
    allocation out into a separate function. This removes a large block
    of logic from the xfs_bmapi() code loop and makes it easier to see
    the operational logic flow for xfs_bmapi().
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 1fd044d9c6735e669f0db025f18023e56a608130
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:49 2011 +0000

    xfs: do not use xfs_bmap_add_extent for adding delalloc extents
    
    We can just call xfs_bmap_add_extent_hole_delay directly to add a
    delayed allocated regions to the extent tree, instead of going
    through all the complexities of xfs_bmap_add_extent that aren't
    needed for this simple case.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 4403280aa5c00c6074f2dc23e1cfc11f2bfb0032
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:48 2011 +0000

    xfs: introduce xfs_bmapi_delay()
    
    Delalloc reservations are much simpler than allocations, so give
    them a separate bmapi-level interface.  Using the previously added
    xfs_bmapi_reserve_delalloc we get a function that is only minimally
    more complicated than xfs_bmapi_read, which is far from the complexity
    in xfs_bmapi.  Also remove the XFS_BMAPI_DELAY code after switching
    over the only user to xfs_bmapi_delay.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit b64dfe4e180ab5047c59bcbe379538eb23be4d8e
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:47 2011 +0000

    xfs: factor delalloc reservations out of xfs_bmapi
    
    Move the reservation of delayed allocations, and addition of delalloc
    regions to the extent trees into a new helper function.  For now
    this adds some twisted goto logic to xfs_bmapi, but that will be
    cleaned up in the following patches.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 5b777ad517ee75d3bb8d67c142d808822e46601b
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:46 2011 +0000

    xfs: remove xfs_bmapi_single()
    
    Now we have xfs_bmapi_read, there is no need for xfs_bmapi_single().
    Change the remaining caller over and kill the function.
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 5c8ed2021ff291f5e399a9b43c4f699b2fc58fbb
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:45 2011 +0000

    xfs: introduce xfs_bmapi_read()
    
    xfs_bmapi() currently handles both extent map reading and
    allocation. As a result, the code is littered with "if (wr)"
    branches to conditionally do allocation operations if required.
    This makes the code much harder to follow and causes significant
    indent issues with the code.
    
    Given that read mapping is much simpler than allocation, we can
    split out read mapping from xfs_bmapi() and reuse the logic that
    we have already factored out do do all the hard work of handling the
    extent map manipulations. The results in a much simpler function for
    the common extent read operations, and will allow the allocation
    code to be simplified in another commit.
    
    Once xfs_bmapi_read() is implemented, convert all the callers of
    xfs_bmapi() that are only reading extents to use the new function.
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit aef9a89586fc8475bf0333b8736d5aa8aa6f4897
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Sun Sep 18 20:40:44 2011 +0000

    xfs: factor extent map manipulations out of xfs_bmapi
    
    To further improve the readability of xfs_bmapi(), factor the pure
    extent map manipulations out into separate functions. This removes
    large blocks of logic from the xfs_bmapi() code loop and makes it
    easier to see the operational logic flow for xfs_bmapi().
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit ecee76ba9d91fdcbdff933ca1bd41465ca4c4fdb
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:43 2011 +0000

    xfs: remove the nextents variable in xfs_bmapi
    
    Instead of using a local variable that needs to updated when we modify
    the extent map just check ifp->if_bytes directly where we use it.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit b9b984d7846e37c57e5b3f8cd883ad45e8ebc2cf
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:42 2011 +0000

    xfs: remove impossible to read code in xfs_bmap_add_extent_delay_real
    
    We already have the worst case blocks reserved, so xfs_icsb_modify_counters
    won't fail in xfs_bmap_add_extent_delay_real.  In fact we've had an assert
    to catch this case since day and it never triggered.  So remove the code
    to try smaller reservations, and just return the error for that case in
    addition to keeping the assert.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit e7455e02e5effcdd49bb28e7dfface2d3473de52
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sun Sep 18 20:40:41 2011 +0000

    xfs: remove the first extent special case in xfs_bmap_add_extent
    
    Both xfs_bmap_add_extent_hole_delay and xfs_bmap_add_extent_hole_real
    already contain code to handle the case where there is no extent to
    merge with, which is effectively the same as the code duplicated here.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit ed32201e65e15f3e6955cb84cbb544b08f81e5a5
Author: Mitsuo Hayasaka <mitsuo.hayasaka.hu@xxxxxxxxxxx>
Date:   Sat Sep 17 13:38:38 2011 +0000

    xfs: Return -EIO when xfs_vn_getattr() failed
    
    An attribute of inode can be fetched via xfs_vn_getattr() in XFS.
    Currently it returns EIO, not negative value, when it failed.  As a
    result, the system call returns not negative value even though an
    error occured. The stat(2), ls and mv commands cannot handle this
    error and do not work correctly.
    
    This patch fixes this bug, and returns -EIO, not EIO when an error
    is detected in xfs_vn_getattr().
    
    Signed-off-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@xxxxxxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit eabbaf118239d0d4188298b52751040f3b4cc28f
Author: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Date:   Thu Sep 8 20:18:50 2011 +0000

    xfs: Fix the incorrect comment in the header of _xfs_buf_find
    
    Fix the incorrect comment in the header of the function
    _xfs_buf_find().
    
    Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 2a30f36d9069b0646dcdd73def5fd7ab674bffd6
Author: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Date:   Tue Sep 20 13:56:55 2011 +0000

    xfs: Check the return value of xfs_trans_get_buf()
    
    Check the return value of xfs_trans_get_buf() and fail
    appropriately.
    
    Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit b522950f0ab8551f2ef56c210ebd50e6c6396601
Author: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Date:   Wed Sep 7 19:37:54 2011 +0000

    xfs: Check the return value of xfs_buf_get()
    
    Check the return value of xfs_buf_get() and fail appropriately.
    
    Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 04f658ee229f60dbb9a0dc2f3d6871b12b758051
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Wed Aug 24 05:59:25 2011 +0000

    xfs: improve ioend error handling
    
    Return unwritten extent conversion errors to aio_complete.
    
    Skip both unwritten extent conversion and size updates if we had an
    I/O error or the filesystem has been shut down.
    
    Return -EIO to the aio/buffer completion handlers in case of a
    forced shutdown.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c58cb165bd44de8aaee9755a144136ae743be116
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sat Aug 27 14:42:53 2011 +0000

    xfs: avoid direct I/O write vs buffered I/O race
    
    Currently a buffered reader or writer can add pages to the pagecache
    while we are waiting for the iolock in xfs_file_dio_aio_write.  Prevent
    this by re-checking mapping->nrpages after we got the iolock, and if
    nessecary upgrade the lock to exclusive mode.  To simplify this a bit
    only take the ilock inside of xfs_file_aio_write_checks.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 859f57ca00805e6c482eef1a7ab073097d02c8ca
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Sat Aug 27 14:45:11 2011 +0000

    xfs: avoid synchronous transactions when deleting attr blocks
    
    Currently xfs_attr_inactive causes a synchronous transactions if we are
    removing a file that has any extents allocated to the attribute fork, and
    thus makes XFS extremely slow at removing files with out of line extended
    attributes. The code looks a like a relict from the days before the busy
    extent list, but with the busy extent list we avoid reusing data and attr
    extents that have been freed but not commited yet, so this code is just
    as superflous as the synchronous transactions for data blocks.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reported-by: Bernd Schubert <bernd.schubert@xxxxxxxxxxxxxxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 4a06fd262dbeb70a2c315f7259e063efa493fe3d
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:13 2011 +0000

    xfs: remove i_iocount
    
    We now have an i_dio_count filed and surrounding infrastructure to wait
    for direct I/O completion instead of i_icount, and we have never needed
    to iocount waits for buffered I/O given that we only set the page uptodate
    after finishing all required work.  Thus remove i_iocount, and replace
    the actually needed waits with calls to inode_dio_wait.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 2b3ffd7eb7b4392e3657c5046b055ca9f1f7cf5e
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:12 2011 +0000

    xfs: wait for I/O completion when writing out pages in xfs_setattr_size
    
    The current code relies on the xfs_ioend_wait call later on to make sure
    all I/O actually has completed.  The xfs_ioend_wait call will go away soon,
    so prepare for that by using the waiting filemap function.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit fc0063c4474599b7a066ba76b90902abe21bc675
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:11 2011 +0000

    xfs: reduce ioend latency
    
    There is no reason to queue up ioends for processing in user context
    unless we actually need it.  Just complete ioends that do not convert
    unwritten extents or need a size update from the end_io context.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c859cdd1da008b3825555be3242908088a3de366
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:10 2011 +0000

    xfs: defer AIO/DIO completions
    
    We really shouldn't complete AIO or DIO requests until we have finished
    the unwritten extent conversion and size update.  This means fsync never
    has to pick up any ioends as all work has been completed when signalling
    I/O completion.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 398d25ef23b10ce75424e0336a8d059dda1dbc8d
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:09 2011 +0000

    xfs: remove dead ENODEV handling in xfs_destroy_ioend
    
    No driver returns ENODEV from it bio completion handler, not has this
    ever been documented.  Remove the dead code dealing with it.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c4e1c098ee8a72ea563a697a2b175868be86fdc9
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:08 2011 +0000

    xfs: use the "delwri" terminology consistently
    
    And also remove the strange local lock and delwri list pointers in a few
    functions.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit c2b006c1da1602551def200e4661535f02b82488
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:07 2011 +0000

    xfs: let xfs_bwrite callers handle the xfs_buf_relse
    
    Remove the xfs_buf_relse from xfs_bwrite and let the caller handle it to
    mirror the delwri and read paths.
    
    Also remove the mount pointer passed to xfs_bwrite, which is superflous now
    that we have a mount pointer in the buftarg.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 61551f1ee536289084a4a8f1c4f187e2f371c440
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:06 2011 +0000

    xfs: call xfs_buf_delwri_queue directly
    
    Unify the ways we add buffers to the delwri queue by always calling
    xfs_buf_delwri_queue directly.  The xfs_bdwrite functions is removed and
    opencoded in its callers, and the two places setting XBF_DELWRI while a
    buffer is locked and expecting xfs_buf_unlock to pick it up are converted
    to call xfs_buf_delwri_queue directly, too.  Also replace the
    XFS_BUF_UNDELAYWRITE macro with direct calls to xfs_buf_delwri_dequeue
    to make the explicit queuing/dequeuing more obvious.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 5a8ee6bafdd0ab8555adceac8b2cec539a552a1f
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:05 2011 +0000

    xfs: move more delwri setup into xfs_buf_delwri_queue
    
    Do not transfer a reference held by the caller to the buffer on the list,
    or decrement it in xfs_buf_delwri_queue, but instead grab a new reference
    if needed, and let the caller drop its own reference.  Also move setting
    of the XBF_DELWRI and XBF_ASYNC flags into xfs_buf_delwri_queue, and
    only do it if needed.  Note that for now xfs_buf_unlock already has
    XBF_DELWRI, but that will change in the following patches.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 527cfdf19dd538a5a9e46b9bed0f30a38c28438d
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:04 2011 +0000

    xfs: remove the unlock argument to xfs_buf_delwri_queue
    
    We can just unlock the buffer in the caller, and the decrement of b_hold
    would also be needed in the !unlock, we just never hit that case currently
    given that the caller handles that case.
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 375ec69d2ef6e0797f19f5823e36e249765c3d41
Author: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date:   Tue Aug 23 08:28:03 2011 +0000

    xfs: remove delwri buffer handling from xfs_buf_iorequest
    
    We cannot ever reach xfs_buf_iorequest for a buffer with XBF_DELWRI set,
    given that all write handlers make sure that the buffer is remove from
    the delwri queue before, and we never do reads with the XBF_DELWRI flag
    set (which the code would not handle correctly anyway).
    
    Signed-off-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 7271d243f9d1b4106289e4cf876c8b1203de59ab
Author: Dave Chinner <david@xxxxxxxxxxxxx>
Date:   Thu Aug 25 07:17:02 2011 +0000

    xfs: don't serialise adjacent concurrent direct IO appending writes
    
    For append write workloads, extending the file requires a certain
    amount of exclusive locking to be done up front to ensure sanity in
    things like ensuring that we've zeroed any allocated regions
    between the old EOF and the start of the new IO.
    
    For single threads, this typically isn't a problem, and for large
    IOs we don't serialise enough for it to be a problem for two
    threads on really fast block devices. However for smaller IO and
    larger thread counts we have a problem.
    
    Take 4 concurrent sequential, single block sized and aligned IOs.
    After the first IO is submitted but before it completes, we end up
    with this state:
    
            IO 1    IO 2    IO 3    IO 4
          +-------+-------+-------+-------+
          ^       ^
          |       |
          |       |
          |       |
          |       \- ip->i_new_size
          \- ip->i_size
    
    And the IO is done without exclusive locking because offset <=
    ip->i_size. When we submit IO 2, we see offset > ip->i_size, and
    grab the IO lock exclusive, because there is a chance we need to do
    EOF zeroing. However, there is already an IO in progress that avoids
    the need for IO zeroing because offset <= ip->i_new_size. hence we
    could avoid holding the IO lock exlcusive for this. Hence after
    submission of the second IO, we'd end up this state:
    
            IO 1    IO 2    IO 3    IO 4
          +-------+-------+-------+-------+
          ^               ^
          |               |
          |               |
          |               |
          |               \- ip->i_new_size
          \- ip->i_size
    
    There is no need to grab the i_mutex of the IO lock in exclusive
    mode if we don't need to invalidate the page cache. Taking these
    locks on every direct IO effective serialises them as taking the IO
    lock in exclusive mode has to wait for all shared holders to drop
    the lock. That only happens when IO is complete, so effective it
    prevents dispatch of concurrent direct IO writes to the same inode.
    
    And so you can see that for the third concurrent IO, we'd avoid
    exclusive locking for the same reason we avoided the exclusive lock
    for the second IO.
    
    Fixing this is a bit more complex than that, because we need to hold
    a write-submission local value of ip->i_new_size to that clearing
    the value is only done if no other thread has updated it before our
    IO completes.....
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

commit 0c38a2512df272b14ef4238b476a2e4f70da1479
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Thu Aug 25 07:17:01 2011 +0000

    xfs: don't serialise direct IO reads on page cache checks
    
    There is no need to grab the i_mutex of the IO lock in exclusive
    mode if we don't need to invalidate the page cache. Taking these
    locks on every direct IO effective serialises them as taking the IO
    lock in exclusive mode has to wait for all shared holders to drop
    the lock. That only happens when IO is complete, so effective it
    prevents dispatch of concurrent direct IO reads to the same inode.
    
    Fix this by taking the IO lock shared to check the page cache state,
    and only then drop it and take the IO lock exclusively if there is
    work to be done. Hence for the normal direct IO case, no exclusive
    locking will occur.
    
    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Tested-by: Joern Engel <joern@xxxxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    Signed-off-by: Alex Elder <aelder@xxxxxxx>

-----------------------------------------------------------------------

Summary of changes:
 fs/xfs/xfs_alloc.c       |    4 +-
 fs/xfs/xfs_aops.c        |  119 +--
 fs/xfs/xfs_aops.h        |    4 +-
 fs/xfs/xfs_attr.c        |   89 +-
 fs/xfs/xfs_attr_leaf.c   |    7 +-
 fs/xfs/xfs_bmap.c        | 2531 +++++++++++++++++++++++-----------------------
 fs/xfs/xfs_bmap.h        |  318 ++-----
 fs/xfs/xfs_btree.c       |   11 +-
 fs/xfs/xfs_buf.c         |  244 ++---
 fs/xfs/xfs_buf.h         |   51 +-
 fs/xfs/xfs_buf_item.c    |   12 +-
 fs/xfs/xfs_da_btree.c    |   54 +-
 fs/xfs/xfs_dfrag.c       |    6 +-
 fs/xfs/xfs_dir2_leaf.c   |    6 +-
 fs/xfs/xfs_discard.c     |   20 +-
 fs/xfs/xfs_dquot.c       |   32 +-
 fs/xfs/xfs_export.c      |   12 +-
 fs/xfs/xfs_file.c        |  168 +++-
 fs/xfs/xfs_filestream.c  |    4 +-
 fs/xfs/xfs_fsops.c       |   60 +-
 fs/xfs/xfs_ialloc.c      |   15 +-
 fs/xfs/xfs_iget.c        |    2 -
 fs/xfs/xfs_inode.c       |   43 +-
 fs/xfs/xfs_inode.h       |    1 -
 fs/xfs/xfs_inode_item.c  |    4 +-
 fs/xfs/xfs_ioctl.c       |    2 +-
 fs/xfs/xfs_iomap.c       |   39 +-
 fs/xfs/xfs_iops.c        |   14 +-
 fs/xfs/xfs_log.c         |   20 +-
 fs/xfs/xfs_log_recover.c |   43 +-
 fs/xfs/xfs_mount.c       |   36 +-
 fs/xfs/xfs_qm.c          |   12 +-
 fs/xfs/xfs_qm_syscalls.c |    2 +-
 fs/xfs/xfs_rename.c      |    8 +-
 fs/xfs/xfs_rtalloc.c     |   48 +-
 fs/xfs/xfs_rw.c          |   23 +-
 fs/xfs/xfs_rw.h          |    2 -
 fs/xfs/xfs_super.c       |   13 +-
 fs/xfs/xfs_sync.c        |   16 +-
 fs/xfs/xfs_trace.h       |    2 +-
 fs/xfs/xfs_trans.c       |   13 +-
 fs/xfs/xfs_trans.h       |    8 +-
 fs/xfs/xfs_trans_ail.c   |   35 +-
 fs/xfs/xfs_trans_buf.c   |   24 +-
 fs/xfs/xfs_trans_inode.c |   25 +-
 fs/xfs/xfs_trans_priv.h  |    1 +
 fs/xfs/xfs_vnodeops.c    |  109 +--
 47 files changed, 1988 insertions(+), 2324 deletions(-)


hooks/post-receive
-- 
XFS development tree

<Prev in Thread] Current Thread [Next in Thread>
  • [XFS updates] XFS development tree branch, for-linus, updated. v3.1-rc3-1242-g9e4c109, xfs <=