|
@@ -1741,19 +1741,6 @@ extern int vfs_dedupe_file_range_compare(struct inode *src, loff_t srcoff,
|
|
|
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 *);
|
|
@@ -2564,6 +2551,19 @@ static inline void file_end_write(struct file *file)
|
|
|
__sb_end_write(file_inode(file)->i_sb, SB_FREEZE_WRITE);
|
|
|
}
|
|
|
|
|
|
+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;
|
|
|
+
|
|
|
+ file_start_write(file_out);
|
|
|
+ ret = vfs_clone_file_range(file_in, pos_in, file_out, pos_out, len);
|
|
|
+ file_end_write(file_out);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* get_write_access() gets write permission for a file.
|
|
|
* put_write_access() releases this write permission.
|