public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Catherine Hoang <catherine.hoang@oracle.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [RFC PATCH v2 2/4] ext2: remove buffer heads from group descriptors
Date: Fri, 28 Mar 2025 11:29:27 -0700	[thread overview]
Message-ID: <20250328182927.GE2803723@frogsfrogsfrogs> (raw)
In-Reply-To: <20250326014928.61507-3-catherine.hoang@oracle.com>

On Tue, Mar 25, 2025 at 06:49:26PM -0700, Catherine Hoang wrote:
> The group descriptors are stored as an array of buffer_heads
> s_group_desc in struct ext2_sb_info. Replace these buffer heads with the
> new ext2_buffer and update the buffer functions accordingly.
> 
> Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
> ---
>  fs/ext2/balloc.c | 24 ++++++++++++------------
>  fs/ext2/ext2.h   |  4 ++--
>  fs/ext2/ialloc.c | 12 ++++++------
>  fs/ext2/super.c  | 10 +++++-----
>  4 files changed, 25 insertions(+), 25 deletions(-)
> 
> diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
> index b8cfab8f98b9..21dafa9ae2ea 100644
> --- a/fs/ext2/balloc.c
> +++ b/fs/ext2/balloc.c
> @@ -38,7 +38,7 @@
>  
>  struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
>  					     unsigned int block_group,
> -					     struct buffer_head ** bh)
> +					     struct ext2_buffer ** buf)
>  {
>  	unsigned long group_desc;
>  	unsigned long offset;
> @@ -63,8 +63,8 @@ struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
>  	}
>  
>  	desc = (struct ext2_group_desc *) sbi->s_group_desc[group_desc]->b_data;
> -	if (bh)
> -		*bh = sbi->s_group_desc[group_desc];
> +	if (buf)
> +		*buf = sbi->s_group_desc[group_desc];

Yeah, these patches would be less long if you'd stuck with the "bh"
name.  I hate how this sounds like busy work, but please put it back to
make reviewing easier.

> @@ -1109,10 +1109,10 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
>  	}
>  	for (i = 0; i < db_count; i++) {
>  		block = descriptor_loc(sb, logic_sb_block, i);
> -		sbi->s_group_desc[i] = sb_bread(sb, block);
> +		sbi->s_group_desc[i] = ext2_read_buffer(sb, block);

ext2_read_buffer can return an ERR_PTR, you need to check for errors
here, not just null pointers.

--D

  reply	other threads:[~2025-03-28 18:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26  1:49 [RFC PATCH v2 0/4] remove buffer heads from ext2 Catherine Hoang
2025-03-26  1:49 ` [RFC PATCH v2 1/4] ext2: remove buffer heads from superblock Catherine Hoang
2025-03-28 18:24   ` Darrick J. Wong
2025-03-26  1:49 ` [RFC PATCH v2 2/4] ext2: remove buffer heads from group descriptors Catherine Hoang
2025-03-28 18:29   ` Darrick J. Wong [this message]
2025-03-26  1:49 ` [RFC PATCH v2 3/4] ext2: remove buffer heads from quota handling Catherine Hoang
2025-03-26  1:49 ` [RFC PATCH v2 4/4] ext2: remove buffer heads from block bitmaps Catherine Hoang
2025-03-27 10:32 ` [RFC PATCH v2 0/4] remove buffer heads from ext2 Christoph Hellwig
2025-04-04 16:43   ` Darrick J. Wong
2025-04-07  6:25     ` Christoph Hellwig
2025-04-07 16:54       ` Darrick J. Wong

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=20250328182927.GE2803723@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=catherine.hoang@oracle.com \
    --cc=linux-ext4@vger.kernel.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