diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-05 22:52:34 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:32:48 -0400 |
commit | 23faa7b8db9be0be4f158cfc558460bb95d9b245 (patch) | |
tree | 0677bd31dd8b65482bf042717f7ba61bb73b51b9 /fs | |
parent | 05bb2e0bc77cb005248be318d2b0ba369b8bbab3 (diff) |
fuse_file_aio_write(): merge initializations of iov_iter
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/file.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 36f15f9c1de2..fc54d04a41e2 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -1217,6 +1217,7 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
1217 | err = generic_write_checks(file, &pos, &count, S_ISBLK(inode->i_mode)); | 1217 | err = generic_write_checks(file, &pos, &count, S_ISBLK(inode->i_mode)); |
1218 | if (err) | 1218 | if (err) |
1219 | goto out; | 1219 | goto out; |
1220 | iov_iter_init(&i, iov, nr_segs, count, 0); | ||
1220 | 1221 | ||
1221 | if (count == 0) | 1222 | if (count == 0) |
1222 | goto out; | 1223 | goto out; |
@@ -1230,7 +1231,6 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
1230 | goto out; | 1231 | goto out; |
1231 | 1232 | ||
1232 | if (file->f_flags & O_DIRECT) { | 1233 | if (file->f_flags & O_DIRECT) { |
1233 | iov_iter_init(&i, iov, nr_segs, count, 0); | ||
1234 | written = generic_file_direct_write(iocb, &i, pos, count, ocount); | 1234 | written = generic_file_direct_write(iocb, &i, pos, count, ocount); |
1235 | if (written < 0 || written == count) | 1235 | if (written < 0 || written == count) |
1236 | goto out; | 1236 | goto out; |
@@ -1256,7 +1256,6 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
1256 | written += written_buffered; | 1256 | written += written_buffered; |
1257 | iocb->ki_pos = pos + written_buffered; | 1257 | iocb->ki_pos = pos + written_buffered; |
1258 | } else { | 1258 | } else { |
1259 | iov_iter_init(&i, iov, nr_segs, count, 0); | ||
1260 | written = fuse_perform_write(file, mapping, &i, pos); | 1259 | written = fuse_perform_write(file, mapping, &i, pos); |
1261 | if (written >= 0) | 1260 | if (written >= 0) |
1262 | iocb->ki_pos = pos + written; | 1261 | iocb->ki_pos = pos + written; |