summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorMateusz Guzik <[email protected]>2020-11-04 17:23:48 -0500
committerBrian Behlendorf <[email protected]>2021-03-12 15:51:39 -0800
commit5ebe425a5bf332ab1d77d78eb3bfd9594b5d7250 (patch)
tree3d7bef17b99d18160814207b62fc55b3ad5acf6d /module/zfs
parent9847f77f012b0ea4d54a7151c726e63122e2117d (diff)
Macroify teardown lock handling
This will allow platforms to implement it as they see fit, in particular in a different manner than rrm locks. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Matt Macy <[email protected]> Signed-off-by: Mateusz Guzik <[email protected]> Closes #11153
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/zfs_ioctl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c
index db02f2ea0..5f291d067 100644
--- a/module/zfs/zfs_ioctl.c
+++ b/module/zfs/zfs_ioctl.c
@@ -1414,15 +1414,17 @@ zfsvfs_hold(const char *name, void *tag, zfsvfs_t **zfvp, boolean_t writer)
if (getzfsvfs(name, zfvp) != 0)
error = zfsvfs_create(name, B_FALSE, zfvp);
if (error == 0) {
- rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER :
- RW_READER, tag);
+ if (writer)
+ ZFS_TEARDOWN_ENTER_WRITE(*zfvp, tag);
+ else
+ ZFS_TEARDOWN_ENTER_READ(*zfvp, tag);
if ((*zfvp)->z_unmounted) {
/*
* XXX we could probably try again, since the unmounting
* thread should be just about to disassociate the
* objset from the zfsvfs.
*/
- rrm_exit(&(*zfvp)->z_teardown_lock, tag);
+ ZFS_TEARDOWN_EXIT(*zfvp, tag);
return (SET_ERROR(EBUSY));
}
}
@@ -1432,7 +1434,7 @@ zfsvfs_hold(const char *name, void *tag, zfsvfs_t **zfvp, boolean_t writer)
static void
zfsvfs_rele(zfsvfs_t *zfsvfs, void *tag)
{
- rrm_exit(&zfsvfs->z_teardown_lock, tag);
+ ZFS_TEARDOWN_EXIT(zfsvfs, tag);
if (zfs_vfs_held(zfsvfs)) {
zfs_vfs_rele(zfsvfs);