From 2f3589348f48777888423b8ef06758cbeaf31674 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Fri, 30 Sep 2022 08:51:13 -0700 Subject: [PATCH] f2fs-tools: set host-aware zoned device similar to host-managed one It'd be good to generate zone-aware sequential writes to both of HA and HM zoned devices. Signed-off-by: Jaegeuk Kim --- fsck/mount.c | 2 +- mkfs/f2fs_format.c | 2 +- mkfs/f2fs_format_main.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 4fe73b3..273b5a1 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -988,7 +988,7 @@ int sanity_check_raw_super(struct f2fs_super_block *sb, enum SB_ADDR sb_addr) } /* Check zoned block device feature */ - if (c.devices[0].zoned_model == F2FS_ZONED_HM && + if (c.devices[0].zoned_model != F2FS_ZONED_NONE && !(sb->feature & cpu_to_le32(F2FS_FEATURE_BLKZONED))) { MSG(0, "\tMissing zoned block device feature\n"); return -1; diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index f56cf5b..10ed74e 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -456,7 +456,7 @@ static int f2fs_prepare_super_block(void) * not overlap to metadata area. */ for (i = 1; i < c.ndevs; i++) { - if (c.devices[i].zoned_model == F2FS_ZONED_HM && + if (c.devices[i].zoned_model != F2FS_ZONED_NONE && c.devices[i].start_blkaddr < get_sb(main_blkaddr)) { MSG(0, "\tError: Conventional device %s is too small," " (%"PRIu64" MiB needed).\n", c.devices[0].path, diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index b8a0758..8b087ff 100644 --- a/mkfs/f2fs_format_main.c +++ b/mkfs/f2fs_format_main.c @@ -482,7 +482,7 @@ int main(int argc, char *argv[]) * Some options are mandatory for host-managed * zoned block devices. */ - if (c.zoned_model == F2FS_ZONED_HM && !c.zoned_mode) { + if (c.zoned_model != F2FS_ZONED_NONE && !c.zoned_mode) { MSG(0, "\tError: zoned block device feature is required\n"); goto err_format; }