diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2010-02-11 18:20:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-07 20:04:51 -0500 |
commit | a2db6842873c8e5a70652f278d469128cb52db70 (patch) | |
tree | 0415c6cfb33753c7a20e05d95e3ce485a60b1f41 /fs/sysfs/file.c | |
parent | e72ceb8ccac5f770b3e696e09bb673dca7024b20 (diff) |
sysfs: Only take active references on attributes.
If we exclude directories and symlinks from the set of sysfs
dirents where we need active references we are left with
sysfs attributes (binary or not).
- Tweak sysfs_deactivate to only do something on attributes
- Move lockdep initialization into sysfs_file_add_mode to
limit it to just attributes.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r-- | fs/sysfs/file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 40961366e929..e222b2582746 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -509,6 +509,7 @@ int sysfs_add_file_mode(struct sysfs_dirent *dir_sd, | |||
509 | if (!sd) | 509 | if (!sd) |
510 | return -ENOMEM; | 510 | return -ENOMEM; |
511 | sd->s_attr.attr = (void *)attr; | 511 | sd->s_attr.attr = (void *)attr; |
512 | sysfs_dirent_init_lockdep(sd); | ||
512 | 513 | ||
513 | sysfs_addrm_start(&acxt, dir_sd); | 514 | sysfs_addrm_start(&acxt, dir_sd); |
514 | rc = sysfs_add_one(&acxt, sd); | 515 | rc = sysfs_add_one(&acxt, sd); |