Skip to content

Commit 2d25344

Browse files
Shaun Tancheffaxboe
authored andcommitted
block: Define zoned block device operations
Define REQ_OP_ZONE_REPORT and REQ_OP_ZONE_RESET for handling zones of host-managed and host-aware zoned block devices. With with these two new operations, the total number of operations defined reaches 8 and still fits with the 3 bits definition of REQ_OP_BITS. Signed-off-by: Shaun Tancheff <[email protected]> Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 987b3b2 commit 2d25344

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

block/blk-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,6 +1941,10 @@ generic_make_request_checks(struct bio *bio)
19411941
case REQ_OP_WRITE_SAME:
19421942
if (!bdev_write_same(bio->bi_bdev))
19431943
goto not_supported;
1944+
case REQ_OP_ZONE_REPORT:
1945+
case REQ_OP_ZONE_RESET:
1946+
if (!bdev_is_zoned(bio->bi_bdev))
1947+
goto not_supported;
19441948
break;
19451949
default:
19461950
break;

include/linux/blk_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ enum req_op {
243243
REQ_OP_SECURE_ERASE, /* request to securely erase sectors */
244244
REQ_OP_WRITE_SAME, /* write same block many times */
245245
REQ_OP_FLUSH, /* request for cache flush */
246+
REQ_OP_ZONE_REPORT, /* Get zone information */
247+
REQ_OP_ZONE_RESET, /* Reset a zone write pointer */
246248
};
247249

248250
#define REQ_OP_BITS 3

0 commit comments

Comments
 (0)