All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Daeho Jeong <daeho43@gmail.com>
Cc: Daeho Jeong <daehojeong@google.com>,
	kernel-team@android.com, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs-tools: remove unnecessary alignment for blocks_for_ssa
Date: Sun, 28 Sep 2025 19:58:51 +0000	[thread overview]
Message-ID: <aNmTex1lM2qGi_hf@google.com> (raw)
In-Reply-To: <20250924185423.1305104-1-daeho43@gmail.com>

On 09/24, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
> 
> total_valid_blks_available is already a multiple of c.blks_per_seg.
> So, we don't need an additional alignment adjustment.

Can we add ASSERT?

> 
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> ---
>  mkfs/f2fs_format.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index b98976c..55a7505 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -500,8 +500,7 @@ static int f2fs_prepare_super_block(void)
>  	if (c.feature & F2FS_FEATURE_RO)
>  		blocks_for_ssa = 0;
>  	else
> -		blocks_for_ssa = total_valid_blks_available /
> -				c.blks_per_seg + 1;
> +		blocks_for_ssa = total_valid_blks_available / c.blks_per_seg;
>  
>  	set_sb(segment_count_ssa, SEG_ALIGN(blocks_for_ssa));
>  
> -- 
> 2.51.0.536.g15c5d4f767-goog
> 


_______________________________________________
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: Jaegeuk Kim <jaegeuk@kernel.org>
To: Daeho Jeong <daeho43@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com,
	Daeho Jeong <daehojeong@google.com>
Subject: Re: [PATCH] f2fs-tools: remove unnecessary alignment for blocks_for_ssa
Date: Sun, 28 Sep 2025 19:58:51 +0000	[thread overview]
Message-ID: <aNmTex1lM2qGi_hf@google.com> (raw)
In-Reply-To: <20250924185423.1305104-1-daeho43@gmail.com>

On 09/24, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@google.com>
> 
> total_valid_blks_available is already a multiple of c.blks_per_seg.
> So, we don't need an additional alignment adjustment.

Can we add ASSERT?

> 
> Signed-off-by: Daeho Jeong <daehojeong@google.com>
> ---
>  mkfs/f2fs_format.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index b98976c..55a7505 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -500,8 +500,7 @@ static int f2fs_prepare_super_block(void)
>  	if (c.feature & F2FS_FEATURE_RO)
>  		blocks_for_ssa = 0;
>  	else
> -		blocks_for_ssa = total_valid_blks_available /
> -				c.blks_per_seg + 1;
> +		blocks_for_ssa = total_valid_blks_available / c.blks_per_seg;
>  
>  	set_sb(segment_count_ssa, SEG_ALIGN(blocks_for_ssa));
>  
> -- 
> 2.51.0.536.g15c5d4f767-goog
> 

  parent reply	other threads:[~2025-09-28 19:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 18:54 [f2fs-dev] [PATCH] f2fs-tools: remove unnecessary alignment for blocks_for_ssa Daeho Jeong
2025-09-24 18:54 ` Daeho Jeong
2025-09-25  9:24 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-09-25  9:24   ` Chao Yu
2025-09-28 19:58 ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2025-09-28 19:58   ` Jaegeuk Kim

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=aNmTex1lM2qGi_hf@google.com \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=daeho43@gmail.com \
    --cc=daehojeong@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@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 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.