block: add zone open, close and finish operations
authorAjay Joshi <ajay.joshi@wdc.com>
Sun, 27 Oct 2019 14:05:45 +0000 (23:05 +0900)
committerJens Axboe <axboe@kernel.dk>
Thu, 7 Nov 2019 13:31:48 +0000 (06:31 -0700)
commit6c1b1da58f8c7a697a88ae35afeba196fc7b701e
tree03a8d6592cc3ea609d37c989fa5c1a533d7b66d6
parentc7a1d926dc4076aadad187614500afcd8de78818
block: add zone open, close and finish operations

Zoned block devices (ZBC and ZAC devices) allow an explicit control
over the condition (state) of zones. The operations allowed are:
* Open a zone: Transition to open condition to indicate that a zone will
  actively be written
* Close a zone: Transition to closed condition to release the drive
  resources used for writing to a zone
* Finish a zone: Transition an open or closed zone to the full
  condition to prevent write operations

To enable this control for in-kernel zoned block device users, define
the new request operations REQ_OP_ZONE_OPEN, REQ_OP_ZONE_CLOSE
and REQ_OP_ZONE_FINISH as well as the generic function
blkdev_zone_mgmt() for submitting these operations on a range of zones.
This results in blkdev_reset_zones() removal and replacement with this
new zone magement function. Users of blkdev_reset_zones() (f2fs and
dm-zoned) are updated accordingly.

Contains contributions from Matias Bjorling, Hans Holmberg,
Dmitry Fomichev, Keith Busch, Damien Le Moal and Christoph Hellwig.

Reviewed-by: Javier González <javier@javigon.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ajay Joshi <ajay.joshi@wdc.com>
Signed-off-by: Matias Bjorling <matias.bjorling@wdc.com>
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/blk-zoned.c
drivers/md/dm-zoned-metadata.c
fs/f2fs/segment.c
include/linux/blk_types.h
include/linux/blkdev.h