]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit05434e2b78754af285614a2eea1764dd3f958687
tree8b1bf48a105a81a61a3a1299b0cf49fd5508ef41
parent8d836d2d37e48ad11a7b8a9431a2830798026b94
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