提交 9aae2050 编写于 作者: D Darrick J. Wong 提交者: Dave Chinner

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: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NAmir Goldstein <amir73il@gmail.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 07d19dc9
...@@ -2009,6 +2009,11 @@ int vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos, ...@@ -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) if (!dst_file->f_op->dedupe_file_range)
goto out_drop_write; 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, ret = dst_file->f_op->dedupe_file_range(src_file, src_pos,
dst_file, dst_pos, len); dst_file, dst_pos, len);
out_drop_write: out_drop_write:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册