Lines Matching full:foo*
404 struct foo {
409 DEFINE_SPINLOCK(foo_mutex);
411 struct foo __rcu *gbl_foo;
414 * Create a new struct foo that is the same as the one currently
426 void foo_update_a(int new_a)
428 struct foo *new_fp;
429 struct foo *old_fp;
432 spin_lock(&foo_mutex);
433 old_fp = rcu_dereference_protected(gbl_foo, lockdep_is_held(&foo_mutex));
437 spin_unlock(&foo_mutex);
450 int foo_get_a(void)
493 In the example above, foo_update_a() blocks until a grace period elapses.
505 so the function is not permitted to block. The foo struct needs to
508 struct foo {
515 The foo_update_a() function might then be written as follows::
518 * Create a new struct foo that is the same as the one currently
530 void foo_update_a(int new_a)
532 struct foo *new_fp;
533 struct foo *old_fp;
536 spin_lock(&foo_mutex);
537 old_fp = rcu_dereference_protected(gbl_foo, lockdep_is_held(&foo_mutex));
541 spin_unlock(&foo_mutex);
542 call_rcu(&old_fp->rcu, foo_reclaim);
545 The foo_reclaim() function might appear as follows::
547 void foo_reclaim(struct rcu_head *rp)
549 struct foo *fp = container_of(rp, struct foo, rcu);
551 foo_cleanup(fp->a);
560 The use of call_rcu() permits the caller of foo_update_a() to
563 RCU distinction between updater, namely foo_update_a(), and reclaimer,
564 namely foo_reclaim().