Re: [PATCH v4 01/20] list: introduce LIST_HEAD_GUARDED

Christoph Hellwig <[email protected]>
Newsgroups org.infradead.lists.linux-nvme,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Mon, Jul 13, 2026 at 05:24:02PM +0530, Nilay Shroff wrote:
> Introduce LIST_HEAD_GUARDED(name, lock) to define a struct list_head
> annotated with __guarded_by(lock). This provides a convenient shorthand
> for defining lock-protected list heads and allows compiler context
> analysis to validate accesses to the list against the associated lock.
> 
> The new helper also reduces boilerplate and improves consistency across
> callers that annotate struct list_head objects with __guarded_by().
> 
> This is a preparatory change for subsequent patches that annotate
> LIST_HEAD() instances with their protecting lock.
> 
> Suggested-by: Christoph Hellwig <[email protected]>
> Signed-off-by: Nilay Shroff <[email protected]>

Looks good:

Reviewed-by: Christoph Hellwig <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.