diff options
author | Christoph Hellwig <hch@lst.de> | 2024-08-27 09:50:48 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-08-28 17:53:58 +0300 |
commit | 1df1d3b2dcaa8a4ff736bf6351ca1a15d924a40f (patch) | |
tree | f409a4371ea5155f5eec84adb51efa19da9c2b56 /fs/xfs/xfs_file.c | |
parent | 57413d8e172c10c90fbd91f98d0f7d8eb27e824c (diff) | |
download | linux-1df1d3b2dcaa8a4ff736bf6351ca1a15d924a40f.tar.xz |
xfs: call xfs_flush_unmap_range from xfs_free_file_space
Call xfs_flush_unmap_range from xfs_free_file_space so that
xfs_file_fallocate doesn't have to predict which mode will call it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240827065123.1762168-5-hch@lst.de
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r-- | fs/xfs/xfs_file.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 4cdc54dc9686..5b9e49da0601 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -890,27 +890,6 @@ xfs_file_fallocate( */ inode_dio_wait(inode); - /* - * Now AIO and DIO has drained we flush and (if necessary) invalidate - * the cached range over the first operation we are about to run. - * - * We care about zero and collapse here because they both run a hole - * punch over the range first. Because that can zero data, and the range - * of invalidation for the shift operations is much larger, we still do - * the required flush for collapse in xfs_prepare_shift(). - * - * Insert has the same range requirements as collapse, and we extend the - * file first which can zero data. Hence insert has the same - * flush/invalidate requirements as collapse and so they are both - * handled at the right time by xfs_prepare_shift(). - */ - if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_ZERO_RANGE | - FALLOC_FL_COLLAPSE_RANGE)) { - error = xfs_flush_unmap_range(ip, offset, len); - if (error) - goto out_unlock; - } - error = file_modified(file); if (error) goto out_unlock; |