diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2020-11-03 02:14:07 +0100 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-11-05 02:41:56 +0100 |
commit | 46afb0628b86347933b16ac966655f74eab65c8c (patch) | |
tree | 58a6da5d685d1b5978fc35971066b16ca173cf22 /fs | |
parent | xfs: fix scrub flagging rtinherit even if there is no rt device (diff) | |
download | linux-46afb0628b86347933b16ac966655f74eab65c8c.tar.xz linux-46afb0628b86347933b16ac966655f74eab65c8c.zip |
xfs: only flush the unshared range in xfs_reflink_unshare
There's no reason to flush an entire file when we're unsharing part of
a file. Therefore, only initiate writeback on the selected range.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_reflink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index 16098dc42add..6fa05fb78189 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -1502,7 +1502,8 @@ xfs_reflink_unshare( &xfs_buffered_write_iomap_ops); if (error) goto out; - error = filemap_write_and_wait(inode->i_mapping); + + error = filemap_write_and_wait_range(inode->i_mapping, offset, len); if (error) goto out; |