summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-03-10 10:30:55 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-07 01:32:50 +0400
commit3320c60b3a26d05666285c55ab08ee043c017ba3 (patch)
treec845310a12f63dd709d7170f4f2e7806d41f3003
parent71d8e532b1549a478e6a6a8a44f309d050294d00 (diff)
downloadlinux-3320c60b3a26d05666285c55ab08ee043c017ba3.tar.xz
dio: take updating ->result into do_direct_IO()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/direct-io.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c
index adfa1fb33456..387d91989c45 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1003,6 +1003,7 @@ do_holes:
1 << blkbits);
sdio->block_in_file++;
block_in_page++;
+ dio->result += 1 << blkbits;
goto next_block;
}
@@ -1044,6 +1045,7 @@ do_holes:
sdio->block_in_file += this_chunk_blocks;
block_in_page += this_chunk_blocks;
sdio->blocks_available -= this_chunk_blocks;
+ dio->result += this_chunk_blocks << blkbits;
next_block:
BUG_ON(sdio->block_in_file > sdio->final_block_in_request);
if (sdio->block_in_file == sdio->final_block_in_request)
@@ -1271,10 +1273,6 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
retval = do_direct_IO(dio, &sdio, &map_bh);
- dio->result += iter->iov[seg].iov_len -
- ((sdio.final_block_in_request - sdio.block_in_file) <<
- blkbits);
-
if (retval) {
dio_cleanup(dio, &sdio);
break;