mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] direct-io: Minor cleanups in do_blockdev_direct_IO
Date: Wed, 21 Feb 2018 19:48:03 +0200	[thread overview]
Message-ID: <d5094e88-76ca-4bb2-c2ba-ec9b56ed9b73@suse.com> (raw)
In-Reply-To: <1501657852-12603-1-git-send-email-nborisov@suse.com>



On  2.08.2017 10:10, Nikolay Borisov wrote:
> 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
> 


Ping on that forgotten one :)

  parent reply	other threads:[~2018-02-21 17:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02  7:10 Nikolay Borisov
2017-08-03 14:08 ` Jeff Moyer
2017-09-15 19:34 ` Nikolay Borisov
2018-02-21 17:48 ` Nikolay Borisov [this message]
2018-02-26  9:54 Nikolay Borisov
2018-03-03  0:24 ` Andrew Morton
2018-03-03  8:16   ` Nikolay Borisov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5094e88-76ca-4bb2-c2ba-ec9b56ed9b73@suse.com \
    --to=nborisov@suse.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®