null_blk: add zoned config support information
Subsystems (2)
PATCH v2 1/1 null_blk: add zoned config support information
If the kernel is built without CONFIG_BLK_DEV_ZONED, a modprobe of the null_blk driver with zoned=1 fails with 'Invalid argument'. This can be confusing to users, prompting a search as to why the parameter is invalid. To assist in that search, add a bit more information to the failure, additionally adding to the documentation that CONFIG_BLK_DEV_ZONED is needed for zoned=1.
--- Documentation/block/null_blk.txt | 3 ++- drivers/block/null_blk.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
Documentation/block/null_blk.txt +2 -1
@@ -88,7 +88,8 @@ shared_tags=[0/1]: Default: 0 zoned=[0/1]: Default: 0 0: Block device is exposed as a random-access block device. - 1: Block device is exposed as a host-managed zoned block device. + 1: Block device is exposed as a host-managed zoned block device. Requires + CONFIG_BLK_DEV_ZONED. zone_size=[MB]: Default: 256 Per zone size when exposed as a zoned block device. Must be a power of two.
drivers/block/null_blk.h +1 -0
@@ -97,6 +97,7 @@ void null_zone_reset(struct nullb_cmd *cmd, sector_t sector);#else static inline int null_zone_init (struct nullb_device *dev) { +pr_err ("CONFIG_BLK_DEV_ZONED not enabled\n" );return -EINVAL ; }static inline void null_zone_exit (struct nullb_device *dev) {}
Signature · 1 line
2.17.2
Quoted 30 lines · John Pittman
If the kernel is built without
CONFIG_BLK_DEV_ZONED, a modprobe of thenull_blkdriver with zoned=1 fails with 'Invalid argument'. This can be confusing to users, prompting a search as to why the parameter is invalid. To assist in that search, add a bit more information to the failure, additionally adding to the documentation thatCONFIG_BLK_DEV_ZONEDis needed for zoned=1.Signed-off-by John Pittman <[email protected]>>---
Documentation/block/null_blk.txt|3 +-+--drivers/block/null_blk.h|1 +-2 files changed, 3 insertions(+-), 1 deletion(-)Documentation/block/null_blk.txt +1
-1--- a/Documentation/block/null_blk.txt +-+-+- b/Documentation/block/null_blk.txt@@-88,7 +-88,8 @@shared_tags=[0/1] Default: 0
zoned=[0/1] Default: 0
0: Block device is exposed as a random-access block device.
- 1: Block device is exposed as a host-managed zoned block device.+- 1: Block device is exposed as a host-managed zoned block device. Requires +- CONFIG_BLK_DEV_ZONED.zone_size=[MB] Default: 256
Per zone size when exposed as a zoned block device. Must be a power of two.drivers/block/null_blk.h +1
-1--- a/drivers/block/null_blk.h +-+-+- b/drivers/block/null_blk.h
Quoted 3 lines
@@-97,6 +-97,7 @@void
null_zone_reset(struct nullb_cmd *cmd, sector_t sector);> #else static inline intnull_zone_init(struct nullb_device *dev)
{>+- pr_err("CONFIG_BLK_DEV_ZONED not enabled\n";> return-EINVAL;> }> static inline voidnull_zone_exit(struct nullb_device *dev){}
Jens, Bart, It occurred to me just now that on the pr_err() message, "null_blk: CONFIG_BLK_DEV_ZONED not enabled" is a little better than "CONFIG_BLK_DEV_ZONED not enabled". It was my intent to include that 'null_blk:', but it slipped my mind at the last moment.
Quoted 44 lines · Bart Van Assche
Quoted 32 lines · John Pittman
If the kernel is built without
CONFIG_BLK_DEV_ZONED, a modprobe of thenull_blkdriver with zoned=1 fails with 'Invalid argument'. This can be confusing to users, prompting a search as to why the parameter is invalid. To assist in that search, add a bit more information to the failure, additionally adding to the documentation thatCONFIG_BLK_DEV_ZONEDis needed for zoned=1.Signed-off-by John Pittman <[email protected]>--- Documentation/block/null_blk.txt | 3 ++- drivers/block/null_blk.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)Documentation/block/null_blk.txt +2
-1@@ -88,7 +88,8 @@ shared_tags=[0/1]: Default: 0 zoned=[0/1]: Default: 0 0: Block device is exposed as a random-access block device. - 1: Block device is exposed as a host-managed zoned block device. + 1: Block device is exposed as a host-managed zoned block device. Requires + CONFIG_BLK_DEV_ZONED. zone_size=[MB]: Default: 256 Per zone size when exposed as a zoned block device. Must be a power of two.drivers/block/null_blk.h +0
-0drivers/block/null_blk.h void null_zone_reset(struct nullb_cmd *cmd, sector_t sector); · line 103
Quoted 7 lines
drivers/block/null_blk.h +1
-0@@ -97,6 +97,7 @@ void null_zone_reset(struct nullb_cmd *cmd, sector_t sector);#else static inline int null_zone_init (struct nullb_device *dev) { +pr_err ("CONFIG_BLK_DEV_ZONED not enabled\n" );return -EINVAL ; }static inline void null_zone_exit (struct nullb_device *dev) {}Reviewed-by Bart Van Assche <[email protected]>
Quoted 4 lines · John Pittman
Jens, Bart, It occurred to me just now that on the
pr_err()message, "null_blk:CONFIG_BLK_DEV_ZONEDnot enabled" is a little better than "CONFIG_BLK_DEV_ZONEDnot enabled". It was my intent to include that 'null_blk:', but it slipped my mind at the last moment.
I applied it just now, and added the prefix to the error message.
Signature · 1 line
Jens Axboe