aboutsummaryrefslogtreecommitdiffstats
path: root/lib/percpu-refcount.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/percpu-refcount.c')
-rw-r--r--lib/percpu-refcount.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c
index 1a17399fc7db..9a78e55fa48f 100644
--- a/lib/percpu-refcount.c
+++ b/lib/percpu-refcount.c
@@ -33,8 +33,8 @@
33 33
34/** 34/**
35 * percpu_ref_init - initialize a percpu refcount 35 * percpu_ref_init - initialize a percpu refcount
36 * @ref: ref to initialize 36 * @ref: percpu_ref to initialize
37 * @release: function which will be called when refcount hits 0 37 * @release: function which will be called when refcount hits 0
38 * 38 *
39 * Initializes the refcount in single atomic counter mode with a refcount of 1; 39 * Initializes the refcount in single atomic counter mode with a refcount of 1;
40 * analagous to atomic_set(ref, 1). 40 * analagous to atomic_set(ref, 1).
@@ -42,7 +42,7 @@
42 * Note that @release must not sleep - it may potentially be called from RCU 42 * Note that @release must not sleep - it may potentially be called from RCU
43 * callback context by percpu_ref_kill(). 43 * callback context by percpu_ref_kill().
44 */ 44 */
45int percpu_ref_init(struct percpu_ref *ref, percpu_ref_release *release) 45int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release)
46{ 46{
47 atomic_set(&ref->count, 1 + PCPU_COUNT_BIAS); 47 atomic_set(&ref->count, 1 + PCPU_COUNT_BIAS);
48 48
@@ -98,6 +98,7 @@ static void percpu_ref_kill_rcu(struct rcu_head *rcu)
98 98
99/** 99/**
100 * percpu_ref_kill - safely drop initial ref 100 * percpu_ref_kill - safely drop initial ref
101 * @ref: percpu_ref to kill
101 * 102 *
102 * Must be used to drop the initial ref on a percpu refcount; must be called 103 * Must be used to drop the initial ref on a percpu refcount; must be called
103 * precisely once before shutdown. 104 * precisely once before shutdown.