Merge tag 'kvmgt-vfio-mdev-for-v4.10-rc1' of git://github.com/01org/gvt-linux
[linux-2.6-block.git] / include / linux / fs.h
index b84230e070be27a74788b7f00d826f541f27b7cb..83de8b6601baf5da358e2acb87f1b90bf41e95e0 100644 (file)
@@ -1731,6 +1731,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 *);