mbox series

[v2,00/12] block: Catch missing debugfs flag array members

Message ID 20240711082339.1155658-1-john.g.garry@oracle.com (mailing list archive)
Headers show
Series block: Catch missing debugfs flag array members | expand

Message

John Garry July 11, 2024, 8:23 a.m. UTC
Currently we rely on the developer to add the appropriate entry to the
debugfs flag array when we add a new member.

This has shown to be error prone.

Add compile-time assertions that we are not missing flag array entries.

A limitation of this approach is that if a non-end-of-array entry was now
later removed from a flag name array, we could not detect that at build
time. But this is unlikely to occur. To actually detect that, we could
make the flag name array entries a flag and name tuple. That would just
add extra complexity and slow the code, which I am not sure if is really
required.

Christoph Hellwig (1):
  block: remove QUEUE_FLAG_STOPPED

John Garry (11):
  block: Make QUEUE_FLAG_x as an enum
  block: Add build-time assert for size of blk_queue_flag_name[]
  block: Catch possible entries missing from hctx_state_name[]
  block: Catch possible entries missing from hctx_flag_name[]
  block: Catch possible entries missing from alloc_policy_name[]
  block: Add missing entries from cmd_flag_name[]
  block: Catch possible entries missing from cmd_flag_name[]
  block: Use enum to define RQF_x bit indexes
  block: Simplify definition of RQF_NAME()
  block: Add zone write plugging entry to rqf_name[]
  block: Catch possible entries missing from rqf_name[]

 block/blk-mq-debugfs.c    |  26 +++++++--
 include/linux/blk-mq.h    | 109 +++++++++++++++++++++++++-------------
 include/linux/blk_types.h |   1 +
 include/linux/blkdev.h    |  31 +++++------
 4 files changed, 109 insertions(+), 58 deletions(-)