void net_lundman_zfs_zvol::stop (IOService *provider) { /* Stop being told about devices leaving */ if (disk_remove_notifier) disk_remove_notifier->remove(); #if 0 // You can not stop unload :( if (zfs_active_fs_count != 0 || spa_busy() || zvol_busy()) { IOLog("ZFS: Can not unload as we have filesystems mounted.\n"); return; } #endif IOLog("ZFS: Attempting to unload ...\n"); super::stop(provider); system_taskq_fini(); zfs_ioctl_osx_fini(); zvol_fini(); zfs_vfsops_fini(); sysctl_unregister_oid(&sysctl__zfs_kext_version); sysctl_unregister_oid(&sysctl__zfs); IOLog("ZFS: Unloaded module\n"); }
void sysctl_unregister() { sysctl_unregister_oid(&sysctl__kern_insomnia_debug); sysctl_unregister_oid(&sysctl__kern_insomnia_battery_state); sysctl_unregister_oid(&sysctl__kern_insomnia_ac_state); sysctl_unregister_oid(&sysctl__kern_insomnia_lidsleep); sysctl_unregister_oid(&sysctl__kern_insomnia); }
void spl_kstat_fini() { /* * Destroy the kstat module/class/name tree * * Done in two passes, first unregisters all * of the oids, second releases all the memory. */ sysctl_tree_node_t *iter = tree_nodes; while (iter) { sysctl_tree_node_t *tn = iter; iter = tn->tn_next; sysctl_unregister_oid(&tn->tn_oid); } while (tree_nodes) { sysctl_tree_node_t *tn = tree_nodes; tree_nodes = tn->tn_next; kfree(tn, sizeof(sysctl_tree_node_t)); } /* * Destroy the root oid */ sysctl_unregister_oid(&sysctl__kstat); }
void Config::sysctl_unregister(void) { sysctl_unregister_oid(&sysctl__karabiner); sysctl_unregister_oid(&sysctl__karabiner_initialized); sysctl_unregister_oid(&sysctl__karabiner_debug); sysctl_unregister_oid(&sysctl__karabiner_debug_pointing); sysctl_unregister_oid(&sysctl__karabiner_debug_devel); }
/** * ntfs_debug_deinit - deinitialize debugging for ntfs * * Deinit the error buffer lock and if compiled with DEBUG, unregister our * sysctl. * * Note we cannot use ntfs_debug(), ntfs_warning(), and ntfs_error() once this * function has been called. */ void ntfs_debug_deinit(void) { #ifdef DEBUG /* Unregister our sysctl. */ sysctl_unregister_oid(&sysctl__vfs_generic_ntfs_debug_messages); sysctl_unregister_oid(&sysctl__vfs_generic_ntfs); #endif mtx_destroy(&ntfs_err_buf_lock); }
void Config::sysctl_unregister(void) { sysctl_unregister_oid(&sysctl__keyremap4macbook); sysctl_unregister_oid(&sysctl__keyremap4macbook_initialized); sysctl_unregister_oid(&sysctl__keyremap4macbook_debug); sysctl_unregister_oid(&sysctl__keyremap4macbook_debug_pointing); sysctl_unregister_oid(&sysctl__keyremap4macbook_debug_devel); }
static void fuse_sysctl_macfuse_stop(void) { int i; for (i = 0; fuse_sysctl_list_macfuse[i]; i++) { sysctl_unregister_oid(fuse_sysctl_list_macfuse[i]); } sysctl_unregister_oid(&sysctl__macfuse); }
void AutoThrottler::destruct() { if (enabled) enabled = false; if (setupDone) stop(); sysctl_unregister_oid(&sysctl__kern_cputhrottle_targetload); sysctl_unregister_oid(&sysctl__kern_cputhrottle_auto); if (perfTimer) { perfTimer->release(); perfTimer = 0; } if (workLoop) { workLoop->release(); workLoop = 0; } }
void kstat_delete(kstat_t *ksp) { ekstat_t *e = (ekstat_t *)ksp; kmutex_t *lock = ksp->ks_lock; int lock_needs_release = 0; // destroy the sysctl if (ksp->ks_type == KSTAT_TYPE_NAMED) { if (lock && MUTEX_NOT_HELD(lock)) { mutex_enter(lock); lock_needs_release = 1; } remove_child_sysctls(e); if (lock_needs_release) { mutex_exit(lock); } } sysctl_unregister_oid(&e->e_oid); if (e->e_vals) { kfree(e->e_vals, sizeof(sysctl_leaf_t) * e->e_num_vals); } cv_destroy(&e->e_cv); kfree(e, e->e_size); }
/* * Unregister sysctl table */ void cfs_unregister_sysctl_table (cfs_sysctl_table_header_t *table) { int i = 0; cfs_sysctl_table_t item; while ((item = table[i++]) != NULL) sysctl_unregister_oid(item); return; }
// ########################################################################### void Insomnia::stop(IOService* provider) { if (_workLoop) { _workLoop->release(); _workLoop = 0; } sysctl_unregister_oid(&sysctl__kern_lidsleep); super::stop(provider); }
kern_return_t OldSysctl_stop (kmod_info_t * ki, void * d) { sysctl_unregister_oid(&sysctl__kern_VAR_KERN_A); sysctl_unregister_oid(&sysctl__TREE); sysctl_unregister_oid(&sysctl__TREE_VAR_TREE_B); sysctl_unregister_oid(&sysctl__TREE_SUBTREE); sysctl_unregister_oid(&sysctl__TREE_SUBTREE_VAR_SUBTREE_C); sysctl_unregister_oid(&sysctl__TREE_SUBTREE_VAR_SUBTREE_D); sysctl_unregister_oid(&sysctl__TREE_SUBTREE_VAR_SUBTREE_E); sysctl_unregister_oid(&sysctl__TREE_SUBTREE_VAR_SUBTREE_F); sysctl_unregister_oid(&sysctl__TREE_SUBTREE_VAR_SUBTREE_G); uprintf("KEXT:%s has been unloaded!\n", ki->name); printf("KEXT:%s has been unloaded!\n", ki->name); return KERN_SUCCESS; }
void fuse_sysctl_stop(void) { int i; for (i = 0; fuse_sysctl_list[i]; i++) { sysctl_unregister_oid(fuse_sysctl_list[i]); } sysctl_unregister_oid(&sysctl__osxfuse); #if OSXFUSE_ENABLE_MACFUSE_MODE lck_mtx_lock(osxfuse_sysctl_lock); thread_deallocate(osxfuse_sysctl_macfuse_thread); if (fuse_macfuse_mode) { fuse_sysctl_macfuse_stop(); } lck_mtx_unlock(osxfuse_sysctl_lock); lck_mtx_free(osxfuse_sysctl_lock, osxfuse_lock_group); lck_grp_free(osxfuse_lock_group); #endif /* OSXFUSE_ENABLE_MACFUSE_MODE */ }
void com_reidburke_air_IntelEnhancedSpeedStep::stop(IOService *provider) { info("Shutting down\n"); if (Throttler) { Throttler->destruct(); Throttler->release(); Throttler = 0; } sysctl_unregister_oid(&sysctl__kern_cputhrottle_curfreq); sysctl_unregister_oid(&sysctl__kern_cputhrottle_freqs); sysctl_unregister_oid(&sysctl__kern_cputhrottle_curvolt); sysctl_unregister_oid(&sysctl__kern_cputhrottle_avgfreq); sysctl_unregister_oid(&sysctl__kern_cputhrottle_factoryvolts); sysctl_unregister_oid(&sysctl__kern_cputhrottle_ctl); sysctl_unregister_oid(&sysctl__kern_cputhrottle_usage); sysctl_unregister_oid(&sysctl__kern_cputhrottle_totalthrottles); super::stop(provider); }
static void remove_child_sysctls(ekstat_t *e) { kstat_t *ksp = &e->e_ks; kstat_named_t *named_base = (kstat_named_t*)(ksp->ks_data); sysctl_leaf_t *vals_base = e->e_vals; for (int i=0; i < ksp->ks_ndata; i++) { if (vals_base[i].l_oid_registered) { sysctl_unregister_oid(&vals_base[i].l_oid); vals_base[i].l_oid_registered = 0; } if (named_base[i].data_type == KSTAT_DATA_INT64 || named_base[i].data_type == KSTAT_DATA_UINT64 || named_base[i].data_type == KSTAT_DATA_STRING) { sysctl_leaf_t *leaf = (sysctl_leaf_t*)vals_base[i].l_oid.oid_arg1; kfree(leaf, sizeof(sysctl_leaf_t)); } } }
/* Register a new filesystem type in the global table */ static int vfs_register(struct vfsconf *vfc) { struct sysctl_oid *oidp; struct vfsops *vfsops; static int once; if (!once) { vattr_null(&va_null); once = 1; } if (vfc->vfc_version != VFS_VERSION) { printf("ERROR: filesystem %s, unsupported ABI version %x\n", vfc->vfc_name, vfc->vfc_version); return (EINVAL); } if (vfs_byname(vfc->vfc_name) != NULL) return EEXIST; vfc->vfc_typenum = maxvfsconf++; TAILQ_INSERT_TAIL(&vfsconf, vfc, vfc_list); /* * If this filesystem has a sysctl node under vfs * (i.e. vfs.xxfs), then change the oid number of that node to * match the filesystem's type number. This allows user code * which uses the type number to read sysctl variables defined * by the filesystem to continue working. Since the oids are * in a sorted list, we need to make sure the order is * preserved by re-registering the oid after modifying its * number. */ sysctl_lock(); SLIST_FOREACH(oidp, &sysctl__vfs_children, oid_link) if (strcmp(oidp->oid_name, vfc->vfc_name) == 0) { sysctl_unregister_oid(oidp); oidp->oid_number = vfc->vfc_typenum; sysctl_register_oid(oidp); break; } sysctl_unlock(); /* * Initialise unused ``struct vfsops'' fields, to use * the vfs_std*() functions. Note, we need the mount * and unmount operations, at the least. The check * for vfsops available is just a debugging aid. */ KASSERT(vfc->vfc_vfsops != NULL, ("Filesystem %s has no vfsops", vfc->vfc_name)); /* * Check the mount and unmount operations. */ vfsops = vfc->vfc_vfsops; KASSERT(vfsops->vfs_mount != NULL, ("Filesystem %s has no mount op", vfc->vfc_name)); KASSERT(vfsops->vfs_unmount != NULL, ("Filesystem %s has no unmount op", vfc->vfc_name)); if (vfsops->vfs_root == NULL) /* return file system's root vnode */ vfsops->vfs_root = vfs_stdroot; if (vfsops->vfs_quotactl == NULL) /* quota control */ vfsops->vfs_quotactl = vfs_stdquotactl; if (vfsops->vfs_statfs == NULL) /* return file system's status */ vfsops->vfs_statfs = vfs_stdstatfs; if (vfsops->vfs_sync == NULL) /* * flush unwritten data (nosync) * file systems can use vfs_stdsync * explicitly by setting it in the * vfsop vector. */ vfsops->vfs_sync = vfs_stdnosync; if (vfsops->vfs_vget == NULL) /* convert an inode number to a vnode */ vfsops->vfs_vget = vfs_stdvget; if (vfsops->vfs_fhtovp == NULL) /* turn an NFS file handle into a vnode */ vfsops->vfs_fhtovp = vfs_stdfhtovp; if (vfsops->vfs_checkexp == NULL) /* check if file system is exported */ vfsops->vfs_checkexp = vfs_stdcheckexp; if (vfsops->vfs_init == NULL) /* file system specific initialisation */ vfsops->vfs_init = vfs_stdinit; if (vfsops->vfs_uninit == NULL) /* file system specific uninitialisation */ vfsops->vfs_uninit = vfs_stduninit; if (vfsops->vfs_extattrctl == NULL) /* extended attribute control */ vfsops->vfs_extattrctl = vfs_stdextattrctl; if (vfsops->vfs_sysctl == NULL) vfsops->vfs_sysctl = vfs_stdsysctl; /* * Call init function for this VFS... */ (*(vfc->vfc_vfsops->vfs_init))(vfc); return 0; }