Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD: Clean up zfsdev_close to match Linux #11720

Merged
merged 4 commits into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/sys/zfs_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ typedef struct zfs_useracct {
} zfs_useracct_t;

#define ZFSDEV_MAX_MINOR (1 << 16)
#define ZFS_MIN_MINOR (ZFSDEV_MAX_MINOR + 1)

#define ZPOOL_EXPORT_AFTER_SPLIT 0x1

Expand Down
18 changes: 8 additions & 10 deletions module/os/freebsd/zfs/kmod_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,23 +182,21 @@ zfsdev_ioctl(struct cdev *dev, ulong_t zcmd, caddr_t arg, int flag,
static void
zfsdev_close(void *data)
{
zfsdev_state_t *zs, *zsp = data;
zfsdev_state_t *zs = data;

ASSERT(zs != NULL);

mutex_enter(&zfsdev_state_lock);
for (zs = zfsdev_state_list; zs != NULL; zs = zs->zs_next) {
if (zs == zsp)
break;
}
if (zs == NULL || zs->zs_minor <= 0) {
mutex_exit(&zfsdev_state_lock);
return;
}

ASSERT(zs->zs_minor != 0);

zs->zs_minor = -1;
zfs_onexit_destroy(zs->zs_onexit);
zfs_zevent_destroy(zs->zs_zevent);
mutex_exit(&zfsdev_state_lock);
zs->zs_onexit = NULL;
zs->zs_zevent = NULL;

mutex_exit(&zfsdev_state_lock);
}

static int
Expand Down