summaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-12-16 11:02:54 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2016-12-16 11:02:54 +0100
commit3616119da484699e7045957c009c13d778563874 (patch)
tree5723a2a32b457559ee898101c18c5ff5aaf9b8ea /fs/read_write.c
parent8d3e2936375bacce6abacbce3917d667e4133409 (diff)
downloadblackbird-obmc-linux-3616119da484699e7045957c009c13d778563874.tar.gz
blackbird-obmc-linux-3616119da484699e7045957c009c13d778563874.zip
vfs: no mnt_want_write_file() in vfs_{copy,clone}_file_range()
We've checked for file_out being opened for write. This ensures that we already have mnt_want_write() on target. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 190e0d362581..3d810a11102c 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1538,9 +1538,7 @@ ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in,
if (len == 0)
return 0;
- ret = mnt_want_write_file(file_out);
- if (ret)
- return ret;
+ sb_start_write(inode_out->i_sb);
ret = -EOPNOTSUPP;
if (file_out->f_op->copy_file_range)
@@ -1559,7 +1557,7 @@ ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in,
inc_syscr(current);
inc_syscw(current);
- mnt_drop_write_file(file_out);
+ sb_end_write(inode_out->i_sb);
return ret;
}
@@ -1685,9 +1683,7 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
if (pos_in + len > i_size_read(inode_in))
return -EINVAL;
- ret = mnt_want_write_file(file_out);
- if (ret)
- return ret;
+ sb_start_write(inode_out->i_sb);
ret = file_in->f_op->clone_file_range(file_in, pos_in,
file_out, pos_out, len);
@@ -1696,7 +1692,7 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
fsnotify_modify(file_out);
}
- mnt_drop_write_file(file_out);
+ sb_end_write(inode_out->i_sb);
return ret;
}
EXPORT_SYMBOL(vfs_clone_file_range);
OpenPOWER on IntegriCloud