From 4990248714e06d4374aab11b62254f923490c033 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 5 Mar 2014 22:52:34 -0500 Subject: [PATCH] fuse_file_aio_write(): merge initializations of iov_iter Signed-off-by: Al Viro --- fs/fuse/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 60356ca1916f..0c16c103b9cf 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, 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; -- 2.39.5