static int zvol_create_minors_cb(spa_t *spa, uint64_t dsobj, const char *dsname, void *arg) { if (strchr(dsname, '/') == NULL) return 0; return __zvol_create_minor(dsname); }
/* * Create a block device minor node and setup the linkage between it * and the specified volume. Once this function returns the block * device is live and ready for use. */ int zvol_create_minor(const char *name) { int error; mutex_enter(&zvol_state_lock); error = __zvol_create_minor(name); mutex_exit(&zvol_state_lock); return (error); }
/* * Create a block device minor node and setup the linkage between it * and the specified volume. Once this function returns the block * device is live and ready for use. */ int zvol_create_minor(const char *name) { int error; mutex_enter(&zvol_state_lock); error = __zvol_create_minor(name, B_FALSE); mutex_exit(&zvol_state_lock); return (SET_ERROR(error)); }
static int snapdev_snapshot_changed_cb(const char *dsname, void *arg) { uint64_t snapdev = *(uint64_t *) arg; if (strchr(dsname, '@') == NULL) return 0; switch (snapdev) { case ZFS_SNAPDEV_VISIBLE: mutex_enter(&zvol_state_lock); (void) __zvol_create_minor(dsname, B_TRUE); mutex_exit(&zvol_state_lock); break; case ZFS_SNAPDEV_HIDDEN: (void) zvol_remove_minor(dsname); break; } return 0; }