From ac296ad4dcd32a4e7618716782fc3f2b69d03a74 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 16 Mar 2017 14:23:40 -0800 Subject: [PATCH] fix percpu_ref_reinit() --- include/linux/percpu-refcount.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h index 2bbd0979..06550564 100644 --- a/include/linux/percpu-refcount.h +++ b/include/linux/percpu-refcount.h @@ -19,12 +19,6 @@ enum { /* @flags for percpu_ref_init() */ enum { - /* - * Start w/ ref == 1 in atomic mode. Can be switched to percpu - * operation using percpu_ref_switch_to_percpu(). If initialized - * with this flag, the ref will stay in atomic mode until - * percpu_ref_switch_to_percpu() is invoked on it. - */ PERCPU_REF_INIT_ATOMIC = 1 << 0, /* @@ -57,13 +51,6 @@ static inline int __must_check percpu_ref_init(struct percpu_ref *ref, return 0; } -static inline void percpu_ref_switch_to_atomic(struct percpu_ref *ref, - percpu_ref_func_t *confirm_switch) {} - -static inline void percpu_ref_switch_to_percpu(struct percpu_ref *ref) {} - -static inline void percpu_ref_reinit(struct percpu_ref *ref) {} - /** * percpu_ref_get_many - increment a percpu refcount * @ref: percpu_ref to get @@ -155,6 +142,11 @@ static inline void percpu_ref_put(struct percpu_ref *ref) percpu_ref_put_many(ref, 1); } +static inline void percpu_ref_reinit(struct percpu_ref *ref) +{ + percpu_ref_get(ref); +} + /** * percpu_ref_kill - drop the initial ref * @ref: percpu_ref to kill