percpu_ref: restructure operation mode switching
commit3f49bdd95855a33eea749304d2e10530a869218b
authorTejun Heo <tj@kernel.org>
Tue, 29 Sep 2015 21:47:19 +0000 (29 17:47 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 10 Aug 2016 19:02:58 +0000 (10 15:02 -0400)
treefe3b7bd2f627ce5fd66084e9e20beec98df1f471
parent18808354b79622ed11857e41f9044ba17aec5b01
percpu_ref: restructure operation mode switching

Restructure atomic/percpu mode switching.

* The users of __percpu_ref_switch_to_atomic/percpu() now call a new
  function __percpu_ref_switch_mode() which calls either of the
  original switching functions depending on the current state of
  ref->force_atomic and the __PERCPU_REF_DEAD flag.  The callers no
  longer check whether switching is necessary but always invoke
  __percpu_ref_switch_mode().

* !ref->confirm_switch waiting is collected into
  __percpu_ref_switch_mode().

This patch doesn't cause any behavior differences.

Signed-off-by: Tejun Heo <tj@kernel.org>
lib/percpu-refcount.c