Lines Matching full:nh

136  *	@nh: Pointer to head of the atomic notifier chain
143 int atomic_notifier_chain_register(struct atomic_notifier_head *nh, in atomic_notifier_chain_register() argument
149 spin_lock_irqsave(&nh->lock, flags); in atomic_notifier_chain_register()
150 ret = notifier_chain_register(&nh->head, n, false); in atomic_notifier_chain_register()
151 spin_unlock_irqrestore(&nh->lock, flags); in atomic_notifier_chain_register()
158 * @nh: Pointer to head of the atomic notifier chain
166 int atomic_notifier_chain_register_unique_prio(struct atomic_notifier_head *nh, in atomic_notifier_chain_register_unique_prio() argument
172 spin_lock_irqsave(&nh->lock, flags); in atomic_notifier_chain_register_unique_prio()
173 ret = notifier_chain_register(&nh->head, n, true); in atomic_notifier_chain_register_unique_prio()
174 spin_unlock_irqrestore(&nh->lock, flags); in atomic_notifier_chain_register_unique_prio()
181 * @nh: Pointer to head of the atomic notifier chain
188 int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh, in atomic_notifier_chain_unregister() argument
194 spin_lock_irqsave(&nh->lock, flags); in atomic_notifier_chain_unregister()
195 ret = notifier_chain_unregister(&nh->head, n); in atomic_notifier_chain_unregister()
196 spin_unlock_irqrestore(&nh->lock, flags); in atomic_notifier_chain_unregister()
204 * @nh: Pointer to head of the atomic notifier chain
219 int atomic_notifier_call_chain(struct atomic_notifier_head *nh, in atomic_notifier_call_chain() argument
225 ret = notifier_call_chain(&nh->head, val, v, -1, NULL); in atomic_notifier_call_chain()
235 * @nh: Pointer to head of the atomic notifier chain
241 bool atomic_notifier_call_chain_is_empty(struct atomic_notifier_head *nh) in atomic_notifier_call_chain_is_empty() argument
243 return !rcu_access_pointer(nh->head); in atomic_notifier_call_chain_is_empty()
251 static int __blocking_notifier_chain_register(struct blocking_notifier_head *nh, in __blocking_notifier_chain_register() argument
263 return notifier_chain_register(&nh->head, n, unique_priority); in __blocking_notifier_chain_register()
265 down_write(&nh->rwsem); in __blocking_notifier_chain_register()
266 ret = notifier_chain_register(&nh->head, n, unique_priority); in __blocking_notifier_chain_register()
267 up_write(&nh->rwsem); in __blocking_notifier_chain_register()
273 * @nh: Pointer to head of the blocking notifier chain
281 int blocking_notifier_chain_register(struct blocking_notifier_head *nh, in blocking_notifier_chain_register() argument
284 return __blocking_notifier_chain_register(nh, n, false); in blocking_notifier_chain_register()
290 * @nh: Pointer to head of the blocking notifier chain
298 int blocking_notifier_chain_register_unique_prio(struct blocking_notifier_head *nh, in blocking_notifier_chain_register_unique_prio() argument
301 return __blocking_notifier_chain_register(nh, n, true); in blocking_notifier_chain_register_unique_prio()
307 * @nh: Pointer to head of the blocking notifier chain
315 int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh, in blocking_notifier_chain_unregister() argument
326 return notifier_chain_unregister(&nh->head, n); in blocking_notifier_chain_unregister()
328 down_write(&nh->rwsem); in blocking_notifier_chain_unregister()
329 ret = notifier_chain_unregister(&nh->head, n); in blocking_notifier_chain_unregister()
330 up_write(&nh->rwsem); in blocking_notifier_chain_unregister()
335 int blocking_notifier_call_chain_robust(struct blocking_notifier_head *nh, in blocking_notifier_call_chain_robust() argument
345 if (rcu_access_pointer(nh->head)) { in blocking_notifier_call_chain_robust()
346 down_read(&nh->rwsem); in blocking_notifier_call_chain_robust()
347 ret = notifier_call_chain_robust(&nh->head, val_up, val_down, v); in blocking_notifier_call_chain_robust()
348 up_read(&nh->rwsem); in blocking_notifier_call_chain_robust()
356 * @nh: Pointer to head of the blocking notifier chain
370 int blocking_notifier_call_chain(struct blocking_notifier_head *nh, in blocking_notifier_call_chain() argument
380 if (rcu_access_pointer(nh->head)) { in blocking_notifier_call_chain()
381 down_read(&nh->rwsem); in blocking_notifier_call_chain()
382 ret = notifier_call_chain(&nh->head, val, v, -1, NULL); in blocking_notifier_call_chain()
383 up_read(&nh->rwsem); in blocking_notifier_call_chain()
396 * @nh: Pointer to head of the raw notifier chain
404 int raw_notifier_chain_register(struct raw_notifier_head *nh, in raw_notifier_chain_register() argument
407 return notifier_chain_register(&nh->head, n, false); in raw_notifier_chain_register()
413 * @nh: Pointer to head of the raw notifier chain
421 int raw_notifier_chain_unregister(struct raw_notifier_head *nh, in raw_notifier_chain_unregister() argument
424 return notifier_chain_unregister(&nh->head, n); in raw_notifier_chain_unregister()
428 int raw_notifier_call_chain_robust(struct raw_notifier_head *nh, in raw_notifier_call_chain_robust() argument
431 return notifier_call_chain_robust(&nh->head, val_up, val_down, v); in raw_notifier_call_chain_robust()
437 * @nh: Pointer to head of the raw notifier chain
452 int raw_notifier_call_chain(struct raw_notifier_head *nh, in raw_notifier_call_chain() argument
455 return notifier_call_chain(&nh->head, val, v, -1, NULL); in raw_notifier_call_chain()
467 * @nh: Pointer to head of the SRCU notifier chain
475 int srcu_notifier_chain_register(struct srcu_notifier_head *nh, in srcu_notifier_chain_register() argument
486 return notifier_chain_register(&nh->head, n, false); in srcu_notifier_chain_register()
488 mutex_lock(&nh->mutex); in srcu_notifier_chain_register()
489 ret = notifier_chain_register(&nh->head, n, false); in srcu_notifier_chain_register()
490 mutex_unlock(&nh->mutex); in srcu_notifier_chain_register()
497 * @nh: Pointer to head of the SRCU notifier chain
505 int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh, in srcu_notifier_chain_unregister() argument
516 return notifier_chain_unregister(&nh->head, n); in srcu_notifier_chain_unregister()
518 mutex_lock(&nh->mutex); in srcu_notifier_chain_unregister()
519 ret = notifier_chain_unregister(&nh->head, n); in srcu_notifier_chain_unregister()
520 mutex_unlock(&nh->mutex); in srcu_notifier_chain_unregister()
521 synchronize_srcu(&nh->srcu); in srcu_notifier_chain_unregister()
528 * @nh: Pointer to head of the SRCU notifier chain
542 int srcu_notifier_call_chain(struct srcu_notifier_head *nh, in srcu_notifier_call_chain() argument
548 idx = srcu_read_lock(&nh->srcu); in srcu_notifier_call_chain()
549 ret = notifier_call_chain(&nh->head, val, v, -1, NULL); in srcu_notifier_call_chain()
550 srcu_read_unlock(&nh->srcu, idx); in srcu_notifier_call_chain()
557 * @nh: Pointer to head of the srcu notifier chain
567 void srcu_init_notifier_head(struct srcu_notifier_head *nh) in srcu_init_notifier_head() argument
569 mutex_init(&nh->mutex); in srcu_init_notifier_head()
570 if (init_srcu_struct(&nh->srcu) < 0) in srcu_init_notifier_head()
572 nh->head = NULL; in srcu_init_notifier_head()