Re: [PATCH 01/19] buffer_head: Remove b_page

Jan Kara <[email protected]> Mon, 3 Aug 2026 18:03:23 +0200
Newsgroups dev.linux.lists.gfs2,dev.linux.lists.ocfs2-devel,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel
Message-ID <opz7bk3tmzyejeqkxyjhm6siyud6rsefjz7cu3y4benupb4yyf@jx7t75od2vyt>
On Sat 01-08-26 18:00:45, Chao Shi wrote:
> From: "Matthew Wilcox (Oracle)" <[email protected]>
> 
> All users except bh_offset() have been converted to use b_folio instead.
> Convert bh_offset() and remove b_page.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
> Signed-off-by: Chao Shi <[email protected]>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <[email protected]>

								Honza

> ---
>  include/linux/buffer_head.h | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
> index fd2c7115c054..699970b4bbf2 100644
> --- a/include/linux/buffer_head.h
> +++ b/include/linux/buffer_head.h
> @@ -59,10 +59,7 @@ struct address_space;
>  struct buffer_head {
>  	unsigned long b_state;		/* buffer state bitmap (see above) */
>  	struct buffer_head *b_this_page;/* circular list of page's buffers */
> -	union {
> -		struct page *b_page;	/* the page this bh is mapped to */
> -		struct folio *b_folio;	/* the folio this bh is mapped to */
> -	};
> +	struct folio *b_folio;		/* the folio this bh is mapped to */
>  
>  	sector_t b_blocknr;		/* start block number */
>  	size_t b_size;			/* size of mapping */
> @@ -172,7 +169,7 @@ static __always_inline int buffer_uptodate(const struct buffer_head *bh)
>  
>  static inline unsigned long bh_offset(const struct buffer_head *bh)
>  {
> -	return (unsigned long)(bh)->b_data & (page_size(bh->b_page) - 1);
> +	return (unsigned long)(bh)->b_data & (folio_size(bh->b_folio) - 1);
>  }
>  
>  /* If we *know* page->private refers to buffer_heads */
> -- 
> 2.43.0
> 
-- 
Jan Kara <[email protected]>
SUSE Labs, CR