]> git.baikalelectronics.ru Git - kernel.git/commit
kernfs: implement kernfs_{de|re}activate[_self]()
authorTejun Heo <tj@kernel.org>
Fri, 10 Jan 2014 13:57:26 +0000 (08:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jan 2014 21:51:21 +0000 (13:51 -0800)
commit016e376949d9bef7c0382f69d7f620c8ab227c70
treee989b667775b3e1bf9b6da90bbaf2815eb103502
parentc7d9c714b082e7fa0a101b3434d57f29803b50e1
kernfs: implement kernfs_{de|re}activate[_self]()

This patch implements four functions to manipulate deactivation state
- deactivate, reactivate and the _self suffixed pair.  A new fields
kernfs_node->deact_depth is added so that concurrent and nested
deactivations are handled properly.  kernfs_node->hash is moved so
that it's paired with the new field so that it doesn't increase the
size of kernfs_node.

A kernfs user's lock would normally nest inside active ref but during
removal the user may want to perform kernfs_remove() while holding the
said lock, which would introduce a reverse locking dependency.  This
function can be used to break such reverse dependency by allowing
deactivation step to performed separately outside user's critical
section.

This will also be used implement kernfs_remove_self().

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/kernfs/dir.c
include/linux/kernfs.h