On 23/12/2024 19:27, Christoph Hellwig wrote:
On Mon, Dec 23, 2024 at 10:41:53AM +0000, John Garry wrote:
Use an enum for tagset flags, so that they don't need to be manually
renumbered when modified.
They don't need to be renumbered.
Sure, they don't need to be. But using an auto-numbered enum makes easy
to catch when we add a flag but don't update the respective debugfs flag
name structure.
Sparse bitfields work just fine
and are a lot simpler and cleaner than the indirection added here.
I don't think that having unused gaps in the bitfields is so neat.
FWIW, this patch could be further improved to remove the ilog2 usage in
HCTX_FLAG_NAME, which is the only remaining debugfs macro to use this.