diff mbox series

block: reorder the REQ_ flags

Message ID 20220510130058.1315400-1-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series block: reorder the REQ_ flags | expand

Commit Message

Christoph Hellwig May 10, 2022, 1 p.m. UTC
Keep the op-specific flag last.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/blk_types.h | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Jens Axboe May 10, 2022, 11:03 p.m. UTC | #1
On 5/10/22 7:00 AM, Christoph Hellwig wrote:
> Keep the op-specific flag last.

Not that I'm against the patch, but we really should have some
justification in the commit message as to why the change is
useful or needed.
Chaitanya Kulkarni May 11, 2022, 7:31 a.m. UTC | #2
On 5/10/2022 4:03 PM, Jens Axboe wrote:
> On 5/10/22 7:00 AM, Christoph Hellwig wrote:
>> Keep the op-specific flag last.
> 
> Not that I'm against the patch, but we really should have some
> justification in the commit message as to why the change is
> useful or needed.
> 

Something like following might be useful :-

"Currently we support seven request flags out of which only
__REQ_NOUNMAP is used with REQ_OP_WRITE_ZEROES, rest of the flags are
not necessarily associated with specific REQ_OP_XXX. Instead of mixing
the request specific flags with the non-request specific flags, move
request specific flags __REQ_NOUNMAP at the end for better readability
so future request specific flags can go at the end."

Full disclosure I've not verified other flags.

-ck
diff mbox series

Patch

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index c62274466e726..9be1225ebe682 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -408,16 +408,14 @@  enum req_flag_bits {
 	 * work item to avoid such priority inversions.
 	 */
 	__REQ_CGROUP_PUNT,
-
-	/* command specific flags for REQ_OP_WRITE_ZEROES: */
-	__REQ_NOUNMAP,		/* do not free blocks when zeroing */
-
 	__REQ_POLLED,		/* caller polls for completion using bio_poll */
 	__REQ_ALLOC_CACHE,	/* allocate IO from cache if available */
+	__REQ_SWAP,		/* swap I/O */
+	__REQ_DRV,		/* for driver use */
+
+	/* 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 */
 };