]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fuse_file_aio_write(): merge initializations of iov_iter
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Mar 2014 03:52:34 +0000 (22:52 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 23 Apr 2014 14:20:36 +0000 (10:20 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fuse/file.c

index 60356ca1916f18775854ac2f835640f0d1410024..0c16c103b9cff2ff4068654c48d04bdd67d46d23 100644 (file)
@@ -1217,6 +1217,7 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
        err = generic_write_checks(file, &pos, &count, S_ISBLK(inode->i_mode));
        if (err)
                goto out;
+       iov_iter_init(&i, iov, nr_segs, count, 0);
 
        if (count == 0)
                goto out;
@@ -1230,7 +1231,6 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
                goto out;
 
        if (file->f_flags & O_DIRECT) {
-               iov_iter_init(&i, iov, nr_segs, count, 0);
                written = generic_file_direct_write(iocb, &i, pos, count, ocount);
                if (written < 0 || written == count)
                        goto out;
@@ -1256,7 +1256,6 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
                written += written_buffered;
                iocb->ki_pos = pos + written_buffered;
        } else {
-               iov_iter_init(&i, iov, nr_segs, count, 0);
                written = fuse_perform_write(file, mapping, &i, pos);
                if (written >= 0)
                        iocb->ki_pos = pos + written;