On 03/01/2025 06:44, Christoph Hellwig wrote:
On Thu, Jan 02, 2025 at 02:44:26PM +0000, John Garry wrote:
Use an enum for tagset flags, so that they are automatically
renumbered when modified and we don't potentially leave
unused gaps. Some may find this neater.
Just as last time around I think this is a bad idea that just creates
more boilerplate.
Pros:
- better to not have unused gaps
- catch missing blk-mq debugfs array names
- this has been a problem in the past
Cons:
- boilerplate
A compromise could be to use some macro to evaluate the flags, like:
#define BLK_MQ_F(flag) (1 << BLK_MQ_B_##flag)
And have, for example:
.flags = BLK_MQ_F(STACKING) | BLK_MQ_F(BLOCKING);
But that will lead to churn in swapping the flag throughout the code and
maybe also obfuscate, so I highly doubt whether it is even better.
Anyway, I've made my pitch.
I actually wrote a series before my vacation to
drop another unused flag, remove the weirdo policy indiretion and
add better max flag checking while removing code. Let me rebase
that, finish writing commit log and send it out.