Skip to contentSkip to conversation

block: reorder and better document the __REQ_* flags

PATCH In review Christoph Hellwig 2 participants 2 messages Jun 25, 2021 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: reorder and better document the __REQ_* flags

Keep the op-specific flag last and make a little more sense of the comments.

---
 include/linux/blk_types.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
include/linux/blk_types.h +5 -6
index db61f7df1823..c80756e9f16e 100644
@@ -381,15 +381,14 @@ enum req_flag_bits {
 	 * work item to avoid such priority inversions.
 	 */
 	__REQ_CGROUP_PUNT,
+	__REQ_HIPRI,		/* High Priority I/O (polled) */
+	__REQ_SWAP,		/* swap I/O */
 
-	/* command specific flags for REQ_OP_WRITE_ZEROES: */
-	__REQ_NOUNMAP,		/* do not free blocks when zeroing */
+	__REQ_DRV,		/* for driver use */
 
-	__REQ_HIPRI,
+	/* command specific flag for REQ_OP_WRITE_ZEROES: */
+	__REQ_NOUNMAP,		/* do not free blocks when zeroing */
 
-	/* for driver use */
-	__REQ_DRV,
-	__REQ_SWAP,		/* swapping request. */
 	__REQ_NR_BITS,		/* stops here */
 };
 
Signature · 1 line
2.30.2
#1 lore raw
Quoted 13 lines · Christoph Hellwig

Keep the op-specific flag last and make a little more sense of the comments.

---
 include/linux/blk_types.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
include/linux/blk_types.h +0 -0
index db61f7df1823..c80756e9f16e 100644

include/linux/blk_types.h enum req_flag_bits { · line 384

Quoted 4 lines
include/linux/blk_types.h +1 -0
@@ -381,15 +381,14 @@ enum req_flag_bits {
 	 * work item to avoid such priority inversions.
 	 */
 	__REQ_CGROUP_PUNT,
+	__REQ_HIPRI,		/* High Priority I/O (polled) */

REQ_HIPRI requests may not have an actual high priority assigned (rq->ioprio). So can we change the comment to only say "/* Polled I/O */". Polled I/O is indeed semantically somewhat equivalent to a high priority request, but I prefer we clearly distinguish it from it the ioprio stuff.

Quoted 17 lines
include/linux/blk_types.h +4 -6
+	__REQ_SWAP,		/* swap I/O */
 
-	/* command specific flags for REQ_OP_WRITE_ZEROES: */
-	__REQ_NOUNMAP,		/* do not free blocks when zeroing */
+	__REQ_DRV,		/* for driver use */
 
-	__REQ_HIPRI,
+	/* command specific flag for REQ_OP_WRITE_ZEROES: */
+	__REQ_NOUNMAP,		/* do not free blocks when zeroing */
 
-	/* for driver use */
-	__REQ_DRV,
-	__REQ_SWAP,		/* swapping request. */
 	__REQ_NR_BITS,		/* stops here */
 };
 
Signature · 2 lines
Damien Le Moal
Western Digital Research