diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2020-11-04 21:19:54 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2020-11-04 21:19:54 +0000 |
commit | 4008dd45816922f5a0d0a197d8c0f9cccd348fc4 (patch) | |
tree | fcf2d8fe0c3fdce53c7fbd35231c5f8d4021a104 /sys/contrib/openzfs/module/zfs | |
parent | ae5642a670c4b9dde6727fac6b45ccfa09a8dbb0 (diff) | |
download | src-4008dd45816922f5a0d0a197d8c0f9cccd348fc4.tar.gz src-4008dd45816922f5a0d0a197d8c0f9cccd348fc4.zip |
zfs: macroify teardown handling
Notes
Notes:
svn path=/head/; revision=367345
Diffstat (limited to 'sys/contrib/openzfs/module/zfs')
-rw-r--r-- | sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/contrib/openzfs/module/zfs/zfs_ioctl.c b/sys/contrib/openzfs/module/zfs/zfs_ioctl.c index 94cd1a3dc834..8703290020a5 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_ioctl.c +++ b/sys/contrib/openzfs/module/zfs/zfs_ioctl.c @@ -1407,15 +1407,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)); } } @@ -1425,7 +1427,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); |