]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: refactor clonerange preparation into a separate helper
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 5 Oct 2018 09:04:22 +0000 (19:04 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 5 Oct 2018 09:04:22 +0000 (19:04 +1000)
commit01208f392d8586f4329dde633bf562bf5e1ce071
treec319317290e83f3c74296aaa2bcefdce20a8b4a0
parent7ad5ee0bec93ea5e8e5311ed4300d651d0024c85
xfs: refactor clonerange preparation into a separate helper

Refactor all the reflink preparation steps into a separate helper
that we'll use to land all the upcoming fixes for insufficient input
checks.

This rework also moves the invalidation of the destination range to
the prep function so that it is done before the range is remapped.
This ensures that nobody can access the data in range being remapped
until the remap is complete.

[dgc: fix xfs_reflink_remap_prep() return value and caller check to
handle vfs_clone_file_prep_inodes() returning 0 to mean "nothing to
do". ]

[dgc: make sure length changed by vfs_clone_file_prep_inodes() gets
propagated back to XFS code that does the remapping. ]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_reflink.c