diff --git a/engines/libzbc.c b/engines/libzbc.c index 3dde93db54..7f2bc431b4 100644 --- a/engines/libzbc.c +++ b/engines/libzbc.c @@ -180,10 +180,8 @@ static int libzbc_get_zoned_model(struct thread_data *td, struct fio_file *f, struct libzbc_data *ld; int ret; - if (f->filetype != FIO_TYPE_BLOCK && f->filetype != FIO_TYPE_CHAR) { - *model = ZBD_IGNORE; - return 0; - } + if (f->filetype != FIO_TYPE_BLOCK && f->filetype != FIO_TYPE_CHAR) + return -EINVAL; ret = libzbc_open_dev(td, f, &ld); if (ret) diff --git a/engines/skeleton_external.c b/engines/skeleton_external.c index c79b6f1114..cff83a10ef 100644 --- a/engines/skeleton_external.c +++ b/engines/skeleton_external.c @@ -156,7 +156,6 @@ static int fio_skeleton_close(struct thread_data *td, struct fio_file *f) /* * Hook for getting the zoned model of a zoned block device for zonemode=zbd. * The zoned model can be one of (see zbd_types.h): - * - ZBD_IGNORE: skip regular files * - ZBD_NONE: regular block device (zone emulation will be used) * - ZBD_HOST_AWARE: host aware zoned block device * - ZBD_HOST_MANAGED: host managed zoned block device diff --git a/oslib/linux-blkzoned.c b/oslib/linux-blkzoned.c index 6f89ec6f41..4e441d29b8 100644 --- a/oslib/linux-blkzoned.c +++ b/oslib/linux-blkzoned.c @@ -140,10 +140,8 @@ int blkzoned_get_zoned_model(struct thread_data *td, struct fio_file *f, { char *model_str = NULL; - if (f->filetype != FIO_TYPE_BLOCK) { - *model = ZBD_IGNORE; - return 0; - } + if (f->filetype != FIO_TYPE_BLOCK) + return -EINVAL; *model = ZBD_NONE; diff --git a/zbd.c b/zbd.c index d1db9adc29..aab4d74136 100644 --- a/zbd.c +++ b/zbd.c @@ -661,8 +661,6 @@ static int zbd_create_zone_info(struct thread_data *td, struct fio_file *f) return ret; switch (zbd_model) { - case ZBD_IGNORE: - return 0; case ZBD_HOST_AWARE: case ZBD_HOST_MANAGED: ret = parse_zone_info(td, f); @@ -680,6 +678,7 @@ static int zbd_create_zone_info(struct thread_data *td, struct fio_file *f) return -EINVAL; } + assert(f->zbd_info); f->zbd_info->model = zbd_model; ret = zbd_set_max_open_zones(td, f); diff --git a/zbd_types.h b/zbd_types.h index d0f4c44e23..0a8630cb71 100644 --- a/zbd_types.h +++ b/zbd_types.h @@ -14,10 +14,9 @@ * Zoned block device models. */ enum zbd_zoned_model { - ZBD_IGNORE, /* Ignore file */ - ZBD_NONE, /* No zone support. Emulate zones. */ - ZBD_HOST_AWARE, /* Host-aware zoned block device */ - ZBD_HOST_MANAGED, /* Host-managed zoned block device */ + ZBD_NONE = 0x1, /* No zone support. Emulate zones. */ + ZBD_HOST_AWARE = 0x2, /* Host-aware zoned block device */ + ZBD_HOST_MANAGED = 0x3, /* Host-managed zoned block device */ }; /*