linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: linux-fscrypt@vger.kernel.org, Eric Biggers <ebiggers@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] fs-verity: use kmap_local_page() instead of kmap()
Date: Fri, 19 Aug 2022 13:14:03 +0200	[thread overview]
Message-ID: <2851124.e9J7NaK4W3@localhost.localdomain> (raw)
In-Reply-To: <20220818224010.43778-1-ebiggers@kernel.org>

On Friday, August 19, 2022 12:40:10 AM CEST Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> Convert the use of kmap() to its recommended replacement
> kmap_local_page().  This avoids the overhead of doing a non-local
> mapping, which is unnecessary in this case.
> 
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  fs/verity/read_metadata.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

It looks good to me...

Reviewed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>

Thanks,

Fabio

> diff --git a/fs/verity/read_metadata.c b/fs/verity/read_metadata.c
> index 6ee849dc7bc183..2aefc5565152ad 100644
> --- a/fs/verity/read_metadata.c
> +++ b/fs/verity/read_metadata.c
> @@ -53,14 +53,14 @@ static int fsverity_read_merkle_tree(struct inode 
*inode,
>  			break;
>  		}
>  
> -		virt = kmap(page);
> +		virt = kmap_local_page(page);
>  		if (copy_to_user(buf, virt + offs_in_page, 
bytes_to_copy)) {
> -			kunmap(page);
> +			kunmap_local(virt);
>  			put_page(page);
>  			err = -EFAULT;
>  			break;
>  		}
> -		kunmap(page);
> +		kunmap_local(virt);
>  		put_page(page);
>  
>  		retval += bytes_to_copy;
> 
> base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
> prerequisite-patch-id: 188e114bdf3546eb18e7984b70be8a7c773acec3
> -- 
> 2.37.1
> 
> 





      parent reply	other threads:[~2022-08-19 11:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 22:40 [PATCH] fs-verity: use kmap_local_page() instead of kmap() Eric Biggers
2022-08-19  7:50 ` Fabio M. De Francesco
2022-08-19 18:29   ` Matthew Wilcox
2022-08-19 22:31     ` Fabio M. De Francesco
2022-08-19 11:14 ` Fabio M. De Francesco [this message]

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=2851124.e9J7NaK4W3@localhost.localdomain \
    --to=fmdefrancesco@gmail.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).