aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-05-09 15:11:53 -0400
committerTejun Heo <tj@kernel.org>2014-05-09 15:42:15 -0400
commit2070d50e1cbe3d7f157cbf8e63279c893f375d7f (patch)
tree0044915780ebcc3ccf0c37c890bb17331b0cc98a
parentfdb9c293decf7e06795f7d9ae409df907c7ae1b6 (diff)
percpu-refcount: rename percpu_ref_tryget() to percpu_ref_tryget_live()
percpu_ref_tryget() is different from the usual tryget semantics in that it fails if the refcnt is in its dying stage even if the refcnt hasn't reached zero yet. We're about to introduce the more conventional tryget and the current one has only one user. Let's rename it to percpu_ref_tryget_live() so that it explicitly signifies the peculiarities of its semantics. This is pure rename. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Kent Overstreet <kmo@daterainc.com>
-rw-r--r--include/linux/cgroup.h2
-rw-r--r--include/linux/percpu-refcount.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index c2515851c1aa..549aed8de32b 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -101,7 +101,7 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
101{ 101{
102 if (css->flags & CSS_ROOT) 102 if (css->flags & CSS_ROOT)
103 return true; 103 return true;
104 return percpu_ref_tryget(&css->refcnt); 104 return percpu_ref_tryget_live(&css->refcnt);
105} 105}
106 106
107/** 107/**
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
index 95961f0bf62d..e22d15597cc3 100644
--- a/include/linux/percpu-refcount.h
+++ b/include/linux/percpu-refcount.h
@@ -118,7 +118,7 @@ static inline void percpu_ref_get(struct percpu_ref *ref)
118} 118}
119 119
120/** 120/**
121 * percpu_ref_tryget - try to increment a percpu refcount 121 * percpu_ref_tryget_live - try to increment a live percpu refcount
122 * @ref: percpu_ref to try-get 122 * @ref: percpu_ref to try-get
123 * 123 *
124 * Increment a percpu refcount unless it has already been killed. Returns 124 * Increment a percpu refcount unless it has already been killed. Returns
@@ -129,7 +129,7 @@ static inline void percpu_ref_get(struct percpu_ref *ref)
129 * used. After the confirm_kill callback is invoked, it's guaranteed that 129 * used. After the confirm_kill callback is invoked, it's guaranteed that
130 * no new reference will be given out by percpu_ref_tryget(). 130 * no new reference will be given out by percpu_ref_tryget().
131 */ 131 */
132static inline bool percpu_ref_tryget(struct percpu_ref *ref) 132static inline bool percpu_ref_tryget_live(struct percpu_ref *ref)
133{ 133{
134 unsigned __percpu *pcpu_count; 134 unsigned __percpu *pcpu_count;
135 int ret = false; 135 int ret = false;