Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1701783 > unrolled thread

[PATCH] direct-io: Minor cleanups in do_blockdev_direct_IO

Started byNikolay Borisov <nborisov@suse.com>
First post2017-08-02 09:20 +0200
Last post2017-08-03 16:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] direct-io: Minor cleanups in do_blockdev_direct_IO Nikolay Borisov <nborisov@suse.com> - 2017-08-02 09:20 +0200
    Re: [PATCH] direct-io: Minor cleanups in do_blockdev_direct_IO Jeff Moyer <jmoyer@redhat.com> - 2017-08-03 16:10 +0200

#1701783 — [PATCH] direct-io: Minor cleanups in do_blockdev_direct_IO

FromNikolay Borisov <nborisov@suse.com>
Date2017-08-02 09:20 +0200
Subject[PATCH] direct-io: Minor cleanups in do_blockdev_direct_IO
Message-ID<u9W6J-6Ni-19@gated-at.bofh.it>
We already get the block counts and the calculate the end block at the
beginning of the function. Let's use the local variables for consistency and
readability. No functional changes

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/direct-io.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 08cf27811e5a..987bc17a5f5e 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1139,7 +1139,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
 	}
 
 	/* watch out for a 0 len io from a tricksy fs */
-	if (iov_iter_rw(iter) == READ && !iov_iter_count(iter))
+	if (iov_iter_rw(iter) == READ && !count)
 		return 0;
 
 	dio = kmem_cache_alloc(dio_cache, GFP_KERNEL);
@@ -1248,8 +1248,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
 
 	dio->should_dirty = (iter->type == ITER_IOVEC);
 	sdio.iter = iter;
-	sdio.final_block_in_request =
-		(offset + iov_iter_count(iter)) >> blkbits;
+	sdio.final_block_in_request = end >> blkbits;
 
 	/*
 	 * In case of non-aligned buffers, we may need 2 more
-- 
2.7.4

[toc] | [next] | [standalone]


#1703149

FromJeff Moyer <jmoyer@redhat.com>
Date2017-08-03 16:10 +0200
Message-ID<uaoZ4-12B-3@gated-at.bofh.it>
In reply to#1701783
Nikolay Borisov <nborisov@suse.com> writes:

> We already get the block counts and the calculate the end block at the
> beginning of the function. Let's use the local variables for consistency and
> readability. No functional changes
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Looks ok to me.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web