All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fscrypt@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/6] fscrypt: Convert bh_get_inode_and_lblk_num to use a folio
Date: Tue, 23 Apr 2024 16:34:38 -0700	[thread overview]
Message-ID: <20240423233438.GA32430@sol.localdomain> (raw)
In-Reply-To: <20240423225552.4113447-2-willy@infradead.org>

On Tue, Apr 23, 2024 at 11:55:32PM +0100, Matthew Wilcox (Oracle) wrote:
> Remove uses of page->index, page_mapping() and b_page.  Saves a call
> to compound_head().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  fs/crypto/inline_crypt.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/crypto/inline_crypt.c b/fs/crypto/inline_crypt.c
> index b4002aea7cdb..40de69860dcf 100644
> --- a/fs/crypto/inline_crypt.c
> +++ b/fs/crypto/inline_crypt.c
> @@ -284,7 +284,7 @@ static bool bh_get_inode_and_lblk_num(const struct buffer_head *bh,
>  				      const struct inode **inode_ret,
>  				      u64 *lblk_num_ret)
>  {
> -	struct page *page = bh->b_page;
> +	struct folio *folio = bh->b_folio;
>  	const struct address_space *mapping;
>  	const struct inode *inode;
>  
> @@ -292,13 +292,13 @@ static bool bh_get_inode_and_lblk_num(const struct buffer_head *bh,
>  	 * The ext4 journal (jbd2) can submit a buffer_head it directly created
>  	 * for a non-pagecache page.  fscrypt doesn't care about these.
>  	 */
> -	mapping = page_mapping(page);
> +	mapping = folio_mapping(folio);
>  	if (!mapping)
>  		return false;
>  	inode = mapping->host;
>  
>  	*inode_ret = inode;
> -	*lblk_num_ret = ((u64)page->index << (PAGE_SHIFT - inode->i_blkbits)) +
> +	*lblk_num_ret = ((u64)folio->index << (PAGE_SHIFT - inode->i_blkbits)) +
>  			(bh_offset(bh) >> inode->i_blkbits);
>  	return true;
>  }

Reviewed-by: Eric Biggers <ebiggers@google.com>

- Eric


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-fscrypt@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/6] fscrypt: Convert bh_get_inode_and_lblk_num to use a folio
Date: Tue, 23 Apr 2024 16:34:38 -0700	[thread overview]
Message-ID: <20240423233438.GA32430@sol.localdomain> (raw)
In-Reply-To: <20240423225552.4113447-2-willy@infradead.org>

On Tue, Apr 23, 2024 at 11:55:32PM +0100, Matthew Wilcox (Oracle) wrote:
> Remove uses of page->index, page_mapping() and b_page.  Saves a call
> to compound_head().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  fs/crypto/inline_crypt.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/crypto/inline_crypt.c b/fs/crypto/inline_crypt.c
> index b4002aea7cdb..40de69860dcf 100644
> --- a/fs/crypto/inline_crypt.c
> +++ b/fs/crypto/inline_crypt.c
> @@ -284,7 +284,7 @@ static bool bh_get_inode_and_lblk_num(const struct buffer_head *bh,
>  				      const struct inode **inode_ret,
>  				      u64 *lblk_num_ret)
>  {
> -	struct page *page = bh->b_page;
> +	struct folio *folio = bh->b_folio;
>  	const struct address_space *mapping;
>  	const struct inode *inode;
>  
> @@ -292,13 +292,13 @@ static bool bh_get_inode_and_lblk_num(const struct buffer_head *bh,
>  	 * The ext4 journal (jbd2) can submit a buffer_head it directly created
>  	 * for a non-pagecache page.  fscrypt doesn't care about these.
>  	 */
> -	mapping = page_mapping(page);
> +	mapping = folio_mapping(folio);
>  	if (!mapping)
>  		return false;
>  	inode = mapping->host;
>  
>  	*inode_ret = inode;
> -	*lblk_num_ret = ((u64)page->index << (PAGE_SHIFT - inode->i_blkbits)) +
> +	*lblk_num_ret = ((u64)folio->index << (PAGE_SHIFT - inode->i_blkbits)) +
>  			(bh_offset(bh) >> inode->i_blkbits);
>  	return true;
>  }

Reviewed-by: Eric Biggers <ebiggers@google.com>

- Eric

  reply	other threads:[~2024-04-23 23:34 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 22:55 [f2fs-dev] [PATCH 0/6] Remove page_mapping() Matthew Wilcox (Oracle)
2024-04-23 22:55 ` Matthew Wilcox (Oracle)
2024-04-23 22:55 ` [f2fs-dev] [PATCH 1/6] fscrypt: Convert bh_get_inode_and_lblk_num to use a folio Matthew Wilcox (Oracle)
2024-04-23 22:55   ` Matthew Wilcox (Oracle)
2024-04-23 23:34   ` Eric Biggers [this message]
2024-04-23 23:34     ` Eric Biggers
2024-04-24 11:53   ` [f2fs-dev] " David Hildenbrand
2024-04-24 11:53     ` David Hildenbrand
2024-04-23 22:55 ` [f2fs-dev] [PATCH 2/6] f2fs: Convert f2fs_clear_page_cache_dirty_tag " Matthew Wilcox (Oracle)
2024-04-23 22:55   ` Matthew Wilcox (Oracle)
2024-04-24 11:53   ` [f2fs-dev] " David Hildenbrand
2024-04-24 11:53     ` David Hildenbrand
2024-04-23 22:55 ` [f2fs-dev] [PATCH 3/6] memory-failure: Remove calls to page_mapping() Matthew Wilcox (Oracle)
2024-04-23 22:55   ` Matthew Wilcox (Oracle)
2024-04-23 23:52   ` [f2fs-dev] " Sidhartha Kumar via Linux-f2fs-devel
2024-04-23 23:52     ` Sidhartha Kumar
2024-04-24 11:54   ` [f2fs-dev] " David Hildenbrand
2024-04-24 11:54     ` David Hildenbrand
2024-04-25  6:21   ` [f2fs-dev] " Miaohe Lin via Linux-f2fs-devel
2024-04-25  6:21     ` Miaohe Lin
2024-04-23 22:55 ` [f2fs-dev] [PATCH 4/6] migrate: Expand the use of folio in __migrate_device_pages() Matthew Wilcox (Oracle)
2024-04-23 22:55   ` Matthew Wilcox (Oracle)
2024-04-24 11:54   ` [f2fs-dev] " David Hildenbrand
2024-04-24 11:54     ` David Hildenbrand
2024-04-23 22:55 ` [f2fs-dev] [PATCH 5/6] userfault; Expand folio use in mfill_atomic_install_pte() Matthew Wilcox (Oracle)
2024-04-23 22:55   ` Matthew Wilcox (Oracle)
2024-04-24 11:55   ` [f2fs-dev] " David Hildenbrand
2024-04-24 11:55     ` David Hildenbrand
2024-04-23 22:55 ` [f2fs-dev] [PATCH 6/6] mm: Remove page_mapping() Matthew Wilcox (Oracle)
2024-04-23 22:55   ` Matthew Wilcox (Oracle)
2024-04-24 11:55   ` [f2fs-dev] " David Hildenbrand
2024-04-24 11:55     ` David Hildenbrand
2024-04-24 23:34     ` [f2fs-dev] " Andrew Morton
2024-04-24 23:34       ` Andrew Morton
2024-04-24 23:59       ` [f2fs-dev] " Matthew Wilcox
2024-04-24 23:59         ` Matthew Wilcox
2024-05-20 21:16 ` [f2fs-dev] [PATCH 0/6] " patchwork-bot+f2fs
2024-05-20 21:16   ` patchwork-bot+f2fs
2024-07-24  2:16 ` patchwork-bot+f2fs
2024-07-24  2:16   ` patchwork-bot+f2fs

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=20240423233438.GA32430@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.