Skip to content

Commit 5f89154

Browse files
johnpgarryaxboe
authored andcommitted
block: Use enum to define RQF_x bit indexes
Similar to what we do for enum req_flag_bits, divide the definition of RQF_x flags into an enum to declare the bits and an actual flag. Tweak some comments to not spill onto new lines. Signed-off-by: John Garry <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 6fa9932 commit 5f89154

File tree

1 file changed

+54
-32
lines changed

1 file changed

+54
-32
lines changed

include/linux/blk-mq.h

Lines changed: 54 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,60 @@ typedef enum rq_end_io_ret (rq_end_io_fn)(struct request *, blk_status_t);
2727
* request flags */
2828
typedef __u32 __bitwise req_flags_t;
2929

30-
/* drive already may have started this one */
31-
#define RQF_STARTED ((__force req_flags_t)(1 << 1))
32-
/* request for flush sequence */
33-
#define RQF_FLUSH_SEQ ((__force req_flags_t)(1 << 4))
34-
/* merge of different types, fail separately */
35-
#define RQF_MIXED_MERGE ((__force req_flags_t)(1 << 5))
36-
/* don't call prep for this one */
37-
#define RQF_DONTPREP ((__force req_flags_t)(1 << 7))
38-
/* use hctx->sched_tags */
39-
#define RQF_SCHED_TAGS ((__force req_flags_t)(1 << 8))
40-
/* use an I/O scheduler for this request */
41-
#define RQF_USE_SCHED ((__force req_flags_t)(1 << 9))
42-
/* vaguely specified driver internal error. Ignored by the block layer */
43-
#define RQF_FAILED ((__force req_flags_t)(1 << 10))
44-
/* don't warn about errors */
45-
#define RQF_QUIET ((__force req_flags_t)(1 << 11))
46-
/* account into disk and partition IO statistics */
47-
#define RQF_IO_STAT ((__force req_flags_t)(1 << 13))
48-
/* runtime pm request */
49-
#define RQF_PM ((__force req_flags_t)(1 << 15))
50-
/* on IO scheduler merge hash */
51-
#define RQF_HASHED ((__force req_flags_t)(1 << 16))
52-
/* track IO completion time */
53-
#define RQF_STATS ((__force req_flags_t)(1 << 17))
54-
/* Look at ->special_vec for the actual data payload instead of the
55-
bio chain. */
56-
#define RQF_SPECIAL_PAYLOAD ((__force req_flags_t)(1 << 18))
57-
/* The request completion needs to be signaled to zone write pluging. */
58-
#define RQF_ZONE_WRITE_PLUGGING ((__force req_flags_t)(1 << 20))
59-
/* ->timeout has been called, don't expire again */
60-
#define RQF_TIMED_OUT ((__force req_flags_t)(1 << 21))
61-
#define RQF_RESV ((__force req_flags_t)(1 << 23))
30+
enum {
31+
/* drive already may have started this one */
32+
__RQF_STARTED,
33+
/* request for flush sequence */
34+
__RQF_FLUSH_SEQ,
35+
/* merge of different types, fail separately */
36+
__RQF_MIXED_MERGE,
37+
/* don't call prep for this one */
38+
__RQF_DONTPREP,
39+
/* use hctx->sched_tags */
40+
__RQF_SCHED_TAGS,
41+
/* use an I/O scheduler for this request */
42+
__RQF_USE_SCHED,
43+
/* vaguely specified driver internal error. Ignored by block layer */
44+
__RQF_FAILED,
45+
/* don't warn about errors */
46+
__RQF_QUIET,
47+
/* account into disk and partition IO statistics */
48+
__RQF_IO_STAT,
49+
/* runtime pm request */
50+
__RQF_PM,
51+
/* on IO scheduler merge hash */
52+
__RQF_HASHED,
53+
/* track IO completion time */
54+
__RQF_STATS,
55+
/* Look at ->special_vec for the actual data payload instead of the
56+
bio chain. */
57+
__RQF_SPECIAL_PAYLOAD,
58+
/* request completion needs to be signaled to zone write plugging. */
59+
__RQF_ZONE_WRITE_PLUGGING,
60+
/* ->timeout has been called, don't expire again */
61+
__RQF_TIMED_OUT,
62+
__RQF_RESV,
63+
__RQF_BITS
64+
};
65+
66+
#define RQF_STARTED ((__force req_flags_t)(1 << __RQF_STARTED))
67+
#define RQF_FLUSH_SEQ ((__force req_flags_t)(1 << __RQF_FLUSH_SEQ))
68+
#define RQF_MIXED_MERGE ((__force req_flags_t)(1 << __RQF_MIXED_MERGE))
69+
#define RQF_DONTPREP ((__force req_flags_t)(1 << __RQF_DONTPREP))
70+
#define RQF_SCHED_TAGS ((__force req_flags_t)(1 << __RQF_SCHED_TAGS))
71+
#define RQF_USE_SCHED ((__force req_flags_t)(1 << __RQF_USE_SCHED))
72+
#define RQF_FAILED ((__force req_flags_t)(1 << __RQF_FAILED))
73+
#define RQF_QUIET ((__force req_flags_t)(1 << __RQF_QUIET))
74+
#define RQF_IO_STAT ((__force req_flags_t)(1 << __RQF_IO_STAT))
75+
#define RQF_PM ((__force req_flags_t)(1 << __RQF_PM))
76+
#define RQF_HASHED ((__force req_flags_t)(1 << __RQF_HASHED))
77+
#define RQF_STATS ((__force req_flags_t)(1 << __RQF_STATS))
78+
#define RQF_SPECIAL_PAYLOAD \
79+
((__force req_flags_t)(1 << __RQF_SPECIAL_PAYLOAD))
80+
#define RQF_ZONE_WRITE_PLUGGING \
81+
((__force req_flags_t)(1 << __RQF_ZONE_WRITE_PLUGGING))
82+
#define RQF_TIMED_OUT ((__force req_flags_t)(1 << __RQF_TIMED_OUT))
83+
#define RQF_RESV ((__force req_flags_t)(1 << __RQF_RESV))
6284

6385
/* flags that prevent us from merging requests: */
6486
#define RQF_NOMERGE_FLAGS \

0 commit comments

Comments
 (0)