aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/percpu-refcount.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/percpu-refcount.h')
-rw-r--r--include/linux/percpu-refcount.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
index b297cd1cd4f1..7aef0abc194a 100644
--- a/include/linux/percpu-refcount.h
+++ b/include/linux/percpu-refcount.h
@@ -75,14 +75,21 @@ enum {
75 * operation using percpu_ref_switch_to_percpu(). If initialized 75 * operation using percpu_ref_switch_to_percpu(). If initialized
76 * with this flag, the ref will stay in atomic mode until 76 * with this flag, the ref will stay in atomic mode until
77 * percpu_ref_switch_to_percpu() is invoked on it. 77 * percpu_ref_switch_to_percpu() is invoked on it.
78 * Implies ALLOW_REINIT.
78 */ 79 */
79 PERCPU_REF_INIT_ATOMIC = 1 << 0, 80 PERCPU_REF_INIT_ATOMIC = 1 << 0,
80 81
81 /* 82 /*
82 * Start dead w/ ref == 0 in atomic mode. Must be revived with 83 * Start dead w/ ref == 0 in atomic mode. Must be revived with
83 * percpu_ref_reinit() before used. Implies INIT_ATOMIC. 84 * percpu_ref_reinit() before used. Implies INIT_ATOMIC and
85 * ALLOW_REINIT.
84 */ 86 */
85 PERCPU_REF_INIT_DEAD = 1 << 1, 87 PERCPU_REF_INIT_DEAD = 1 << 1,
88
89 /*
90 * Allow switching from atomic mode to percpu mode.
91 */
92 PERCPU_REF_ALLOW_REINIT = 1 << 2,
86}; 93};
87 94
88struct percpu_ref { 95struct percpu_ref {
@@ -95,6 +102,7 @@ struct percpu_ref {
95 percpu_ref_func_t *release; 102 percpu_ref_func_t *release;
96 percpu_ref_func_t *confirm_switch; 103 percpu_ref_func_t *confirm_switch;
97 bool force_atomic:1; 104 bool force_atomic:1;
105 bool allow_reinit:1;
98 struct rcu_head rcu; 106 struct rcu_head rcu;
99}; 107};
100 108