mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +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
@@ -1233,7 +1233,7 @@ zvol_first_open(zvol_state_t *zv, boolean_t readonly)
|
||||
|
||||
ASSERT(RW_READ_HELD(&zv->zv_suspend_lock));
|
||||
ASSERT(MUTEX_HELD(&zv->zv_state_lock));
|
||||
ASSERT(mutex_owned(&spa_namespace_lock));
|
||||
ASSERT(spa_namespace_held());
|
||||
|
||||
boolean_t ro = (readonly || (strchr(zv->zv_name, '@') != NULL));
|
||||
error = dmu_objset_own(zv->zv_name, DMU_OST_ZVOL, ro, B_TRUE, zv, &os);
|
||||
@@ -1303,7 +1303,7 @@ zvol_create_snap_minor_cb(const char *dsname, void *arg)
|
||||
list_t *minors_list = j->list;
|
||||
const char *name = j->name;
|
||||
|
||||
ASSERT0(MUTEX_HELD(&spa_namespace_lock));
|
||||
ASSERT0(spa_namespace_held());
|
||||
|
||||
/* skip the designated dataset */
|
||||
if (name && strcmp(dsname, name) == 0)
|
||||
@@ -1403,7 +1403,7 @@ zvol_create_minors_cb(const char *dsname, void *arg)
|
||||
int error;
|
||||
list_t *minors_list = arg;
|
||||
|
||||
ASSERT0(MUTEX_HELD(&spa_namespace_lock));
|
||||
ASSERT0(spa_namespace_held());
|
||||
|
||||
error = dsl_prop_get_integer(dsname, "snapdev", &snapdev, NULL);
|
||||
if (error)
|
||||
|
||||
Reference in New Issue
Block a user