/** * srcu_init_notifier_head - Initialize an SRCU notifier head * @nh: Pointer to head of the srcu notifier chain * * Unlike other sorts of notifier heads, SRCU notifier heads require * dynamic initialization. Be sure to call this routine before * calling any of the other SRCU notifier routines for this head. * * If an SRCU notifier head is deallocated, it must first be cleaned * up by calling srcu_cleanup_notifier_head(). Otherwise the head's * per-cpu data (used by the SRCU mechanism) will leak. */ void srcu_init_notifier_head(struct srcu_notifier_head *nh) { mutex_init(&nh->mutex); if (init_srcu_struct(&nh->srcu) < 0) BUG(); nh->head = NULL; }
void kvm_page_track_init(struct kvm *kvm) { struct kvm_page_track_notifier_head *head; head = &kvm->arch.track_notifier_head; init_srcu_struct(&head->track_srcu); INIT_HLIST_HEAD(&head->track_notifier_list); }
static int __init init_verihmac(void) { if (!security_module_enable(&verihmac_security_ops)) return 0; if (register_security(&verihmac_security_ops) || init_srcu_struct(&verihmac_ss)) panic("Failure registering Verihmac Linux"); printk(VERI_INFO "verihmac Linux initialized\n"); isloaded =1; return 0; }
static int __init ccs_init_module(void) { if (ccsecurity_ops.disabled) return -EINVAL; #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 0) MOD_INC_USE_COUNT; #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) if (init_srcu_struct(&ccs_ss)) panic("Out of memory."); #endif ccs_proc_init(); ccs_mm_init(); ccs_capability_init(); ccs_file_init(); ccs_network_init(); ccs_signal_init(); ccs_mount_init(); ccs_maymount_init(); ccs_policy_io_init(); ccs_domain_init(); return 0; }
static void srcu_sync_perf_init(void) { srcu_ctlp = &srcud; init_srcu_struct(srcu_ctlp); }