vfs: plumb remap flags through the vfs clone functions
Plumb a remap_flags argument through the {do,vfs}_clone_file_range functions so that clone can take advantage of it. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
42ec3d4c02
commit
452ce65951
@ -142,7 +142,7 @@ static int ovl_copy_up_data(struct path *old, struct path *new, loff_t len)
|
||||
}
|
||||
|
||||
/* Try to use clone_file_range to clone up within the same fs */
|
||||
cloned = do_clone_file_range(old_file, 0, new_file, 0, len);
|
||||
cloned = do_clone_file_range(old_file, 0, new_file, 0, len, 0);
|
||||
if (cloned == len)
|
||||
goto out;
|
||||
/* Couldn't clone, so now we try to copy the data */
|
||||
|
@ -462,7 +462,7 @@ static loff_t ovl_copyfile(struct file *file_in, loff_t pos_in,
|
||||
|
||||
case OVL_CLONE:
|
||||
ret = vfs_clone_file_range(real_in.file, pos_in,
|
||||
real_out.file, pos_out, len);
|
||||
real_out.file, pos_out, len, flags);
|
||||
break;
|
||||
|
||||
case OVL_DEDUPE:
|
||||
@ -512,8 +512,8 @@ static loff_t ovl_remap_file_range(struct file *file_in, loff_t pos_in,
|
||||
!ovl_inode_upper(file_inode(file_out))))
|
||||
return -EPERM;
|
||||
|
||||
return ovl_copyfile(file_in, pos_in, file_out, pos_out, len, 0,
|
||||
op);
|
||||
return ovl_copyfile(file_in, pos_in, file_out, pos_out, len,
|
||||
remap_flags, op);
|
||||
}
|
||||
|
||||
const struct file_operations ovl_file_operations = {
|
||||
|
Reference in New Issue
Block a user