Skip to content

Commit 19de03b

Browse files
damien-lemoalaxboe
authored andcommitted
block: make REQ_OP_ZONE_OPEN a write operation
A REQ_OP_OPEN_ZONE request changes the condition of a sequential zone of a zoned block device to the explicitly open condition (BLK_ZONE_COND_EXP_OPEN). As such, it should be considered a write operation. Change this operation code to be an odd number to reflect this. The following operation numbers are changed to keep the numbering compact. No problems were reported without this change as this operation has no data. However, this unifies the zone operation to reflect that they modify the device state and also allows strengthening checks in the block layer, e.g. checking if this operation is not issued against a read-only device. Fixes: 6c1b1da ("block: add zone open, close and finish operations") Cc: [email protected] Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 12a1c93 commit 19de03b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/linux/blk_types.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,15 @@ enum req_op {
341341
/* write the zero filled sector many times */
342342
REQ_OP_WRITE_ZEROES = (__force blk_opf_t)9,
343343
/* Open a zone */
344-
REQ_OP_ZONE_OPEN = (__force blk_opf_t)10,
344+
REQ_OP_ZONE_OPEN = (__force blk_opf_t)11,
345345
/* Close a zone */
346-
REQ_OP_ZONE_CLOSE = (__force blk_opf_t)11,
346+
REQ_OP_ZONE_CLOSE = (__force blk_opf_t)13,
347347
/* Transition a zone to full */
348-
REQ_OP_ZONE_FINISH = (__force blk_opf_t)13,
348+
REQ_OP_ZONE_FINISH = (__force blk_opf_t)15,
349349
/* reset a zone write pointer */
350-
REQ_OP_ZONE_RESET = (__force blk_opf_t)15,
350+
REQ_OP_ZONE_RESET = (__force blk_opf_t)17,
351351
/* reset all the zone present on the device */
352-
REQ_OP_ZONE_RESET_ALL = (__force blk_opf_t)17,
352+
REQ_OP_ZONE_RESET_ALL = (__force blk_opf_t)19,
353353

354354
/* Driver private requests */
355355
REQ_OP_DRV_IN = (__force blk_opf_t)34,

0 commit comments

Comments
 (0)