sysfs: remove sysfs_addrm_cxt->parent_sd
authorTejun Heo <tj@kernel.org>
Wed, 18 Sep 2013 21:15:35 +0000 (17:15 -0400)
committerPawel Osmialowski <p.osmialowsk@mcdsrvbld02.digital.local>
Fri, 27 Mar 2015 17:13:09 +0000 (18:13 +0100)
commit22c92b3e0d2517f2a61272bdab9dbbadb26038fe
tree224d837fca23a2de255a4522b41fb35df3b5dd9d
parentdb6a95c67dba656de2d2aa25cfea5d647170063d
sysfs: remove sysfs_addrm_cxt->parent_sd

sysfs_addrm_start/finish() enclose sysfs_dirent additions and
deletions and sysfs_addrm_cxt is used to record information necessary
to finish the operations.  Currently, sysfs_addrm_start() takes
@parent_sd, records it in sysfs_addrm_cxt, and assumes that all
operations in the block are performed under that @parent_sd.

This assumption has been fine until now but we want to make some
operations behave recursively and, while having @parent_sd recorded in
sysfs_addrm_cxt doesn't necessarily prevents that, it becomes
confusing.

This patch removes sysfs_addrm_cxt->parent_sd and makes
sysfs_add_one() take an explicit @parent_sd parameter.  Note that
sysfs_remove_one() doesn't need the extra argument as its parent is
always known from the target @sd.

While at it, add __acquires/releases() notations to
sysfs_addrm_start/finish() respectively.

This patch doesn't make any functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/sysfs/dir.c
fs/sysfs/file.c
fs/sysfs/inode.c
fs/sysfs/symlink.c
fs/sysfs/sysfs.h