From: Yohan Joung <jyh429@gmail.com>
To: jaegeuk@kernel.org, chao@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH] mkfs.f2fs: adjust zone alignment when using convention partition with zoned one
Date: Tue, 10 Sep 2024 22:56:36 +0900 [thread overview]
Message-ID: <20240910135636.471-1-yohan.joung@sk.com> (raw)
When formatting conventional partition with zoned one, we are already
aligning the starting block address of the next device to the zone size.
Therefore, we do not align the segment0 address to the zone alignment.
This reduces the wasted zone_align_start_offset.
Signed-off-by: Yohan Joung <yohan.joung@sk.com>
---
mkfs/f2fs_format.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 37d23f3..71f5ec8 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -252,11 +252,19 @@ static int f2fs_prepare_super_block(void)
set_sb(block_count, c.total_sectors >> log_sectors_per_block);
- zone_align_start_offset =
- ((uint64_t) c.start_sector * DEFAULT_SECTOR_SIZE +
- 2 * F2FS_BLKSIZE + zone_size_bytes - 1) /
- zone_size_bytes * zone_size_bytes -
- (uint64_t) c.start_sector * DEFAULT_SECTOR_SIZE;
+ if (c.zoned_mode && c.ndevs > 1) {
+ zone_align_start_offset =
+ ((uint64_t) c.start_sector * DEFAULT_SECTOR_SIZE +
+ 2 * F2FS_BLKSIZE + segment_size_bytes - 1) /
+ segment_size_bytes * segment_size_bytes -
+ (uint64_t) c.start_sector * DEFAULT_SECTOR_SIZE;
+ } else {
+ zone_align_start_offset =
+ ((uint64_t) c.start_sector * DEFAULT_SECTOR_SIZE +
+ 2 * F2FS_BLKSIZE + zone_size_bytes - 1) /
+ zone_size_bytes * zone_size_bytes -
+ (uint64_t) c.start_sector * DEFAULT_SECTOR_SIZE;
+ }
if (c.feature & F2FS_FEATURE_RO)
zone_align_start_offset = 8192;
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next reply other threads:[~2024-09-10 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 13:56 Yohan Joung [this message]
2024-10-28 18:05 ` [f2fs-dev] [PATCH] mkfs.f2fs: adjust zone alignment when using convention partition with zoned one Daeho Jeong
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=20240910135636.471-1-yohan.joung@sk.com \
--to=jyh429@gmail.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--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 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).