• Tejun Heo's avatar
    percpu_ref: restructure operation mode switching · 3f49bdd9
    Tejun Heo authored
    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: default avatarTejun Heo <tj@kernel.org>
    3f49bdd9
percpu-refcount.c 11.2 KB