diff options
author | Tejun Heo <tj@kernel.org> | 2013-09-18 17:15:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-03 19:16:43 -0400 |
commit | d69ac5a0bbcf1d9962883fb23e337caf5b38cec8 (patch) | |
tree | 6b9762ddd39b4eec11334886c6907fc9265854d3 /fs/sysfs/symlink.c | |
parent | 5b8802143a4a3e38906879e78f2c1415c5b3db73 (diff) |
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>
Diffstat (limited to 'fs/sysfs/symlink.c')
-rw-r--r-- | fs/sysfs/symlink.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index 88c8bc5e8911..22ea2f5796f5 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
@@ -53,11 +53,11 @@ static int sysfs_do_create_link_sd(struct sysfs_dirent *parent_sd, | |||
53 | sd->s_symlink.target_sd = target_sd; | 53 | sd->s_symlink.target_sd = target_sd; |
54 | target_sd = NULL; /* reference is now owned by the symlink */ | 54 | target_sd = NULL; /* reference is now owned by the symlink */ |
55 | 55 | ||
56 | sysfs_addrm_start(&acxt, parent_sd); | 56 | sysfs_addrm_start(&acxt); |
57 | if (warn) | 57 | if (warn) |
58 | error = sysfs_add_one(&acxt, sd); | 58 | error = sysfs_add_one(&acxt, sd, parent_sd); |
59 | else | 59 | else |
60 | error = __sysfs_add_one(&acxt, sd); | 60 | error = __sysfs_add_one(&acxt, sd, parent_sd); |
61 | sysfs_addrm_finish(&acxt); | 61 | sysfs_addrm_finish(&acxt); |
62 | 62 | ||
63 | if (error) | 63 | if (error) |