|
@@ -1848,12 +1848,15 @@ int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
|
|
|
EXPORT_SYMBOL(generic_remap_file_range_prep);
|
|
|
|
|
|
loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
|
|
|
- struct file *file_out, loff_t pos_out, loff_t len)
|
|
|
+ struct file *file_out, loff_t pos_out,
|
|
|
+ loff_t len, unsigned int remap_flags)
|
|
|
{
|
|
|
struct inode *inode_in = file_inode(file_in);
|
|
|
struct inode *inode_out = file_inode(file_out);
|
|
|
loff_t ret;
|
|
|
|
|
|
+ WARN_ON_ONCE(remap_flags);
|
|
|
+
|
|
|
if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode))
|
|
|
return -EISDIR;
|
|
|
if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode))
|
|
@@ -1884,7 +1887,7 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
|
|
|
return ret;
|
|
|
|
|
|
ret = file_in->f_op->remap_file_range(file_in, pos_in,
|
|
|
- file_out, pos_out, len, 0);
|
|
|
+ file_out, pos_out, len, remap_flags);
|
|
|
if (ret < 0)
|
|
|
return ret;
|
|
|
|
|
@@ -1895,12 +1898,14 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
|
|
|
EXPORT_SYMBOL(do_clone_file_range);
|
|
|
|
|
|
loff_t vfs_clone_file_range(struct file *file_in, loff_t pos_in,
|
|
|
- struct file *file_out, loff_t pos_out, loff_t len)
|
|
|
+ struct file *file_out, loff_t pos_out,
|
|
|
+ loff_t len, unsigned int remap_flags)
|
|
|
{
|
|
|
loff_t ret;
|
|
|
|
|
|
file_start_write(file_out);
|
|
|
- ret = do_clone_file_range(file_in, pos_in, file_out, pos_out, len);
|
|
|
+ ret = do_clone_file_range(file_in, pos_in, file_out, pos_out, len,
|
|
|
+ remap_flags);
|
|
|
file_end_write(file_out);
|
|
|
|
|
|
return ret;
|