diff options
author | Amir Goldstein <amir73il@gmail.com> | 2016-09-23 11:38:11 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2016-12-16 13:02:54 +0300 |
commit | 031a072a0b8ac2646def77aa310a95016c884bb0 (patch) | |
tree | 26e34c8c636fe13aa0d4e14cf16226333f6f43dd /include | |
parent | 913b86e92e1f68ab9db00ccb0fecf594732511e5 (diff) | |
download | linux-031a072a0b8ac2646def77aa310a95016c884bb0.tar.xz |
vfs: call vfs_clone_file_range() under freeze protection
Move sb_start_write()/sb_end_write() out of the vfs helper and up into the
ioctl handler.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index dc0478c07b2a..52663f1f3084 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1783,6 +1783,19 @@ extern int vfs_clone_file_range(struct file *file_in, loff_t pos_in, extern int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same); +static inline int do_clone_file_range(struct file *file_in, loff_t pos_in, + struct file *file_out, loff_t pos_out, + u64 len) +{ + int ret; + + sb_start_write(file_inode(file_out)->i_sb); + ret = vfs_clone_file_range(file_in, pos_in, file_out, pos_out, len); + sb_end_write(file_inode(file_out)->i_sb); + + return ret; +} + struct super_operations { struct inode *(*alloc_inode)(struct super_block *sb); void (*destroy_inode)(struct inode *); |