mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
spa_misc: add an API for spa_namespace_lock
This is useful as debugging support, as it lets namespace lock operations be traced directly. It will also be useful for future work to reduce the use of spa_namespace_lock, traditionally a source of difficult deadlocks. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #17906
This commit is contained in:
committed by
Brian Behlendorf
parent
e305c7d596
commit
ac0bc4cc00
+3
-3
@@ -1580,10 +1580,10 @@ zfs_ereport_zvol_post(const char *subclass, const char *name,
|
||||
nvlist_t *aux;
|
||||
char *r;
|
||||
|
||||
boolean_t locked = mutex_owned(&spa_namespace_lock);
|
||||
if (!locked) mutex_enter(&spa_namespace_lock);
|
||||
boolean_t locked = spa_namespace_held();
|
||||
if (!locked) spa_namespace_enter(FTAG);
|
||||
spa_t *spa = spa_lookup(name);
|
||||
if (!locked) mutex_exit(&spa_namespace_lock);
|
||||
if (!locked) spa_namespace_exit(FTAG);
|
||||
|
||||
if (spa == NULL)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user