]> www.infradead.org Git - nvme.git/commitdiff
block: Name the RQF flags enum
authorBreno Leitao <leitao@debian.org>
Thu, 6 Mar 2025 16:27:51 +0000 (08:27 -0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 7 Mar 2025 00:50:55 +0000 (17:50 -0700)
Commit 5f89154e8e9e3445f9b59 ("block: Use enum to define RQF_x bit
indexes") converted the RQF flags to an anonymous enum, which was
a beneficial change. This patch goes one step further by naming the enum
as "rqf_flags".

This naming enables exporting these flags to BPF clients, eliminating
the need to duplicate these flags in BPF code. Instead, BPF clients can
now access the same kernel-side values through CO:RE (Compile Once, Run
Everywhere), as shown in this example:

    rqf_stats = bpf_core_enum_value(enum rqf_flags, __RQF_STATS)

Suggested-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20250306-rqf_flags-v1-1-bbd64918b406@debian.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/blk-mq.h

index fa2a76cc2f73d125373a753bd37cc4f2f31375ec..71f4f0cc3dac672d1b118e9877ba0edf47458d3a 100644 (file)
@@ -28,7 +28,7 @@ typedef enum rq_end_io_ret (rq_end_io_fn)(struct request *, blk_status_t);
 typedef __u32 __bitwise req_flags_t;
 
 /* Keep rqf_name[] in sync with the definitions below */
-enum {
+enum rqf_flags {
        /* drive already may have started this one */
        __RQF_STARTED,
        /* request for flush sequence */