mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
nvme: add context annotations for nvme_dev::shutdown_lock
nvme_setup_io_queues_trylock() conditionally acquires dev->shutdown_lock using mutex_trylock(). The function returns 0 when the lock is successfully acquired and a negative error code otherwise. Annotate the function with __cond_acquires(0, &dev->shutdown_lock) so that Clang's lock context analysis can track the lock state based on the return value and verify correct lock usage at call sites. 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
696d2aeb77
commit
4258bf237e
|
|
@ -2199,6 +2199,7 @@ static void nvme_init_queue(struct nvme_queue *nvmeq, u16 qid)
|
|||
* Try getting shutdown_lock while setting up IO queues.
|
||||
*/
|
||||
static int nvme_setup_io_queues_trylock(struct nvme_dev *dev)
|
||||
__cond_acquires(0, &dev->shutdown_lock)
|
||||
{
|
||||
/*
|
||||
* Give up if the lock is being held by nvme_dev_disable.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user