xfs: flush both inodes in xfs_swap_extents
authorDave Chinner <dchinner@redhat.com>
Mon, 4 Aug 2014 03:44:08 +0000 (13:44 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 4 Aug 2014 03:44:08 +0000 (13:44 +1000)
commit4ef897a27543b513351262881660147366c042a1
tree8b1bf48a105a81a61a3a1299b0cf49fd5508ef41
parent812176832169c77b4bacddd01edc3e55340263fd
xfs: flush both inodes in xfs_swap_extents

We need to treat both inodes identically from a page cache point of
view when prepareing them for extent swapping. We don't do this
right now - we assume that one of the inodes empty, because that's
what xfs_fsr currently does. Remove this assumption from the code.

While factoring out the flushing and related checks, move the
transactions reservation to immeidately after the flushes so that we
don't need to pick up and then drop the ilock to do the transaction
reservation. There are no issues with aborting the transaction it if
the checks fail before we join the inodes to the transaction and
dirty them, so this is a safe change to make.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_bmap_util.c