aboutsummaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-19 21:01:03 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:12:55 -0400
commit8d71db4f0890605d44815a2b2da4ca003f1bb142 (patch)
treee5bb078717c3e8ace7f032b940ada7901dbab545 /fs/read_write.c
parent5f2e354f5212a49fc639c25de2581cc8ae90d11b (diff)
lift sb_start_write/sb_end_write out of ->aio_write()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index f7b5a23b804b..3e1791a2cfd6 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -398,6 +398,7 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof
398 struct kiocb kiocb; 398 struct kiocb kiocb;
399 ssize_t ret; 399 ssize_t ret;
400 400
401 file_start_write(filp);
401 init_sync_kiocb(&kiocb, filp); 402 init_sync_kiocb(&kiocb, filp);
402 kiocb.ki_pos = *ppos; 403 kiocb.ki_pos = *ppos;
403 kiocb.ki_left = len; 404 kiocb.ki_left = len;
@@ -413,6 +414,7 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof
413 if (-EIOCBQUEUED == ret) 414 if (-EIOCBQUEUED == ret)
414 ret = wait_on_sync_kiocb(&kiocb); 415 ret = wait_on_sync_kiocb(&kiocb);
415 *ppos = kiocb.ki_pos; 416 *ppos = kiocb.ki_pos;
417 file_end_write(filp);
416 return ret; 418 return ret;
417} 419}
418 420
@@ -758,10 +760,12 @@ static ssize_t do_readv_writev(int type, struct file *file,
758 fnv = file->f_op->aio_write; 760 fnv = file->f_op->aio_write;
759 } 761 }
760 762
761 if (fnv) 763 if (fnv) {
764 file_start_write(file);
762 ret = do_sync_readv_writev(file, iov, nr_segs, tot_len, 765 ret = do_sync_readv_writev(file, iov, nr_segs, tot_len,
763 pos, fnv); 766 pos, fnv);
764 else 767 file_end_write(file);
768 } else
765 ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn); 769 ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn);
766 770
767out: 771out: