mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
nvme: add context annotations in fabric.c
The global nvmf_transports list is protected by nvmf_transports_rwsem and the global nvmf_hosts list is protected by nvmf_hosts_mutex. Define both lists using LIST_HEAD_GUARDED() so that Clang's context analysis can validate accesses to the lists against the corresponding locking requirements. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nilay Shroff <nilay@linux.ibm.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
parent
8aa68dba25
commit
50be6cb15f
|
|
@ -14,11 +14,11 @@
|
|||
#include "fabrics.h"
|
||||
#include <linux/nvme-keyring.h>
|
||||
|
||||
static LIST_HEAD(nvmf_transports);
|
||||
static DECLARE_RWSEM(nvmf_transports_rwsem);
|
||||
static LIST_HEAD_GUARDED(nvmf_transports, nvmf_transports_rwsem);
|
||||
|
||||
static LIST_HEAD(nvmf_hosts);
|
||||
static DEFINE_MUTEX(nvmf_hosts_mutex);
|
||||
static LIST_HEAD_GUARDED(nvmf_hosts, nvmf_hosts_mutex);
|
||||
|
||||
static struct nvmf_host *nvmf_default_host;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user