null_blk: Cleanup zoned device initialization
authorDamien Le Moal <damien.lemoal@wdc.com>
Thu, 23 Apr 2020 03:02:38 +0000 (12:02 +0900)
committerJens Axboe <axboe@kernel.dk>
Thu, 23 Apr 2020 15:35:09 +0000 (09:35 -0600)
commitd205bde78fa53e1ce256b1f7f65ede9696d73ee5
treeda25bfbabdb51f3c6b6a6fd3d38685f8b02423f5
parent9dd44c7e998e66f749348d07a700034f513ea9ff
null_blk: Cleanup zoned device initialization

Move all zoned mode related code from null_blk_main.c to
null_blk_zoned.c, avoiding an ugly #ifdef in the process.
Rename null_zone_init() into null_init_zoned_dev(), null_zone_exit()
into null_free_zoned_dev() and add the new function
null_register_zoned_dev() to finalize the zoned dev setup before
add_disk().

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk.h
drivers/block/null_blk_main.c
drivers/block/null_blk_zoned.c