diff options
author | Tejun Heo <htejun@gmail.com> | 2007-08-02 08:38:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:51:03 -0400 |
commit | 41fc1c27452e041a18e5141b8203ee0ea72bc483 (patch) | |
tree | fc81138ca37182c25931818681630c90b018b127 /fs/sysfs/sysfs.h | |
parent | ff869de7bf5e76adffebd3a176c1c73bca7eddb7 (diff) |
sysfs: make sysfs_add/remove_one() call link/unlink_sibling() implictly
When adding or removing a sysfs_dirent, the user used to be required
to call link/unlink separately. It was for two reasons - code looked
like that before sysfs_addrm_cxt conversion and to avoid looping
through parent_sd->children list twice during removal.
Performance optimization during removal just isn't worth it. Make
sysfs_add/remove_one() call sysfs_link/unlink_sibing() implicitly.
This makes code simpler albeit slightly less efficient. This change
doesn't introduce any noticeable behavior change.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r-- | fs/sysfs/sysfs.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index b55e510ea239..32b8b64e5cf1 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h | |||
@@ -56,8 +56,6 @@ extern struct sysfs_dirent sysfs_root; | |||
56 | extern struct kmem_cache *sysfs_dir_cachep; | 56 | extern struct kmem_cache *sysfs_dir_cachep; |
57 | 57 | ||
58 | extern struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd); | 58 | extern struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd); |
59 | extern void sysfs_link_sibling(struct sysfs_dirent *sd); | ||
60 | extern void sysfs_unlink_sibling(struct sysfs_dirent *sd); | ||
61 | extern struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd); | 59 | extern struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd); |
62 | extern void sysfs_put_active(struct sysfs_dirent *sd); | 60 | extern void sysfs_put_active(struct sysfs_dirent *sd); |
63 | extern struct sysfs_dirent *sysfs_get_active_two(struct sysfs_dirent *sd); | 61 | extern struct sysfs_dirent *sysfs_get_active_two(struct sysfs_dirent *sd); |