]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
percpu-refcount: rename percpu_ref_tryget() to percpu_ref_tryget_live()
authorTejun Heo <tj@kernel.org>
Fri, 9 May 2014 19:11:53 +0000 (15:11 -0400)
committerTejun Heo <tj@kernel.org>
Fri, 9 May 2014 19:42:15 +0000 (15:42 -0400)
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>
include/linux/cgroup.h
include/linux/percpu-refcount.h

index c2515851c1aa2038c5298c8ab3288d469cd3bb5b..549aed8de32b8f526e496c97b1f4c70b1ff392ae 100644 (file)
@@ -101,7 +101,7 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
 {
        if (css->flags & CSS_ROOT)
                return true;
-       return percpu_ref_tryget(&css->refcnt);
+       return percpu_ref_tryget_live(&css->refcnt);
 }
 
 /**
index 95961f0bf62d4212002a63efb29f28dfe5e6ab1b..e22d15597cc37deafc079a66f07283a7112bf81b 100644 (file)
@@ -118,7 +118,7 @@ static inline void percpu_ref_get(struct percpu_ref *ref)
 }
 
 /**
- * percpu_ref_tryget - try to increment a percpu refcount
+ * percpu_ref_tryget_live - try to increment a live percpu refcount
  * @ref: percpu_ref to try-get
  *
  * 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)
  * used.  After the confirm_kill callback is invoked, it's guaranteed that
  * no new reference will be given out by percpu_ref_tryget().
  */
-static inline bool percpu_ref_tryget(struct percpu_ref *ref)
+static inline bool percpu_ref_tryget_live(struct percpu_ref *ref)
 {
        unsigned __percpu *pcpu_count;
        int ret = false;