From: Tejun Heo Date: Wed, 24 Sep 2014 17:31:50 +0000 (-0400) Subject: percpu_ref: make INIT_ATOMIC and switch_to_atomic() sticky X-Git-Tag: fixes-against-v3.18-rc2~134^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cae13e75b7a7848c03138636d4eb8d8a5054dd5;p=pandora-kernel.git percpu_ref: make INIT_ATOMIC and switch_to_atomic() sticky Currently, a percpu_ref which is initialized with PERPCU_REF_INIT_ATOMIC or switched to atomic mode via switch_to_atomic() automatically reverts to percpu mode on the first percpu_ref_reinit(). This makes the atomic mode difficult to use for cases where a percpu_ref is used as a persistent on/off switch which may be cycled multiple times. This patch makes such atomic state sticky so that it survives through kill/reinit cycles. After this patch, atomic state is cleared only by an explicit percpu_ref_switch_to_percpu() call. Signed-off-by: Tejun Heo Reviewed-by: Kent Overstreet Cc: Jens Axboe Cc: Christoph Hellwig Cc: Johannes Weiner --- Reading git-diff-tree failed