mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 04:00:52 +07:00
vfs: skip zero-length dedupe requests
Don't bother calling the filesystem for a zero-length dedupe request; we can return zero and exit. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
07d19dc9fb
commit
9aae20500d
@ -2009,6 +2009,11 @@ int vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
|
||||
if (!dst_file->f_op->dedupe_file_range)
|
||||
goto out_drop_write;
|
||||
|
||||
if (len == 0) {
|
||||
ret = 0;
|
||||
goto out_drop_write;
|
||||
}
|
||||
|
||||
ret = dst_file->f_op->dedupe_file_range(src_file, src_pos,
|
||||
dst_file, dst_pos, len);
|
||||
out_drop_write:
|
||||
|
Loading…
Reference in New Issue
Block a user