[PATCHv2 07/17] nvme: add Clang context annotations for nvme_subsystem::lock

Christoph Hellwig hch at lst.de
Wed Jul 8 23:20:14 PDT 2026


On Tue, Jun 30, 2026 at 01:12:55AM +0200, Marco Elver wrote:
> Initialization of guarded objects has gone through a few iterations,

And all of them suck badly, with the current one being the worse.

> so I don't want to open that can of worms again. I think the
> infrastructure we have now provides various options (the scoped guard
> machinery isn't the only way). You could just write:
> 
> /* Initializes unpublished lock-guarded variables. */
> context_unsafe(
>     INIT_LIST_HEAD(&subsys->nsheads);
>     // ... other guarded var init in same block ...
> );

Using all these silly context makes it total mess unfortunately.




More information about the Linux-nvme mailing list