Commit 5f89154e authored by John Garry's avatar John Garry Committed by Jens Axboe

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: default avatarJohn Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20240719112912.3830443-14-john.g.garry@oracle.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6fa99325
...@@ -27,38 +27,60 @@ typedef enum rq_end_io_ret (rq_end_io_fn)(struct request *, blk_status_t); ...@@ -27,38 +27,60 @@ typedef enum rq_end_io_ret (rq_end_io_fn)(struct request *, blk_status_t);
* request flags */ * request flags */
typedef __u32 __bitwise req_flags_t; typedef __u32 __bitwise req_flags_t;
/* drive already may have started this one */ enum {
#define RQF_STARTED ((__force req_flags_t)(1 << 1)) /* drive already may have started this one */
/* request for flush sequence */ __RQF_STARTED,
#define RQF_FLUSH_SEQ ((__force req_flags_t)(1 << 4)) /* request for flush sequence */
/* merge of different types, fail separately */ __RQF_FLUSH_SEQ,
#define RQF_MIXED_MERGE ((__force req_flags_t)(1 << 5)) /* merge of different types, fail separately */
/* don't call prep for this one */ __RQF_MIXED_MERGE,
#define RQF_DONTPREP ((__force req_flags_t)(1 << 7)) /* don't call prep for this one */
/* use hctx->sched_tags */ __RQF_DONTPREP,
#define RQF_SCHED_TAGS ((__force req_flags_t)(1 << 8)) /* use hctx->sched_tags */
/* use an I/O scheduler for this request */ __RQF_SCHED_TAGS,
#define RQF_USE_SCHED ((__force req_flags_t)(1 << 9)) /* use an I/O scheduler for this request */
/* vaguely specified driver internal error. Ignored by the block layer */ __RQF_USE_SCHED,
#define RQF_FAILED ((__force req_flags_t)(1 << 10)) /* vaguely specified driver internal error. Ignored by block layer */
/* don't warn about errors */ __RQF_FAILED,
#define RQF_QUIET ((__force req_flags_t)(1 << 11)) /* don't warn about errors */
/* account into disk and partition IO statistics */ __RQF_QUIET,
#define RQF_IO_STAT ((__force req_flags_t)(1 << 13)) /* account into disk and partition IO statistics */
/* runtime pm request */ __RQF_IO_STAT,
#define RQF_PM ((__force req_flags_t)(1 << 15)) /* runtime pm request */
/* on IO scheduler merge hash */ __RQF_PM,
#define RQF_HASHED ((__force req_flags_t)(1 << 16)) /* on IO scheduler merge hash */
/* track IO completion time */ __RQF_HASHED,
#define RQF_STATS ((__force req_flags_t)(1 << 17)) /* track IO completion time */
/* Look at ->special_vec for the actual data payload instead of the __RQF_STATS,
bio chain. */ /* Look at ->special_vec for the actual data payload instead of the
#define RQF_SPECIAL_PAYLOAD ((__force req_flags_t)(1 << 18)) bio chain. */
/* The request completion needs to be signaled to zone write pluging. */ __RQF_SPECIAL_PAYLOAD,
#define RQF_ZONE_WRITE_PLUGGING ((__force req_flags_t)(1 << 20)) /* request completion needs to be signaled to zone write plugging. */
/* ->timeout has been called, don't expire again */ __RQF_ZONE_WRITE_PLUGGING,
#define RQF_TIMED_OUT ((__force req_flags_t)(1 << 21)) /* ->timeout has been called, don't expire again */
#define RQF_RESV ((__force req_flags_t)(1 << 23)) __RQF_TIMED_OUT,
__RQF_RESV,
__RQF_BITS
};
#define RQF_STARTED ((__force req_flags_t)(1 << __RQF_STARTED))
#define RQF_FLUSH_SEQ ((__force req_flags_t)(1 << __RQF_FLUSH_SEQ))
#define RQF_MIXED_MERGE ((__force req_flags_t)(1 << __RQF_MIXED_MERGE))
#define RQF_DONTPREP ((__force req_flags_t)(1 << __RQF_DONTPREP))
#define RQF_SCHED_TAGS ((__force req_flags_t)(1 << __RQF_SCHED_TAGS))
#define RQF_USE_SCHED ((__force req_flags_t)(1 << __RQF_USE_SCHED))
#define RQF_FAILED ((__force req_flags_t)(1 << __RQF_FAILED))
#define RQF_QUIET ((__force req_flags_t)(1 << __RQF_QUIET))
#define RQF_IO_STAT ((__force req_flags_t)(1 << __RQF_IO_STAT))
#define RQF_PM ((__force req_flags_t)(1 << __RQF_PM))
#define RQF_HASHED ((__force req_flags_t)(1 << __RQF_HASHED))
#define RQF_STATS ((__force req_flags_t)(1 << __RQF_STATS))
#define RQF_SPECIAL_PAYLOAD \
((__force req_flags_t)(1 << __RQF_SPECIAL_PAYLOAD))
#define RQF_ZONE_WRITE_PLUGGING \
((__force req_flags_t)(1 << __RQF_ZONE_WRITE_PLUGGING))
#define RQF_TIMED_OUT ((__force req_flags_t)(1 << __RQF_TIMED_OUT))
#define RQF_RESV ((__force req_flags_t)(1 << __RQF_RESV))
/* flags that prevent us from merging requests: */ /* flags that prevent us from merging requests: */
#define RQF_NOMERGE_FLAGS \ #define RQF_NOMERGE_FLAGS \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment