diff options
author | Tejun Heo <htejun@gmail.com> | 2007-06-13 15:27:22 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:09:08 -0400 |
commit | 608e266a2d4e62c1b98c1c573064b6afe8c06a58 (patch) | |
tree | 73d670ab6c315b42273bc9d2731ec2b8e7c199af /include | |
parent | f0b0af4792d751106e2003f96af76fa95e10c68d (diff) |
sysfs: make kobj point to sysfs_dirent instead of dentry
As kobj sysfs dentries and inodes are gonna be made reclaimable,
dentry can't be used as naming token for sysfs file/directory, replace
kobj->dentry with kobj->sd. The only external interface change is
shadow directory handling. All other changes are contained in kobj
and sysfs.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kobject.h | 9 | ||||
-rw-r--r-- | include/linux/sysfs.h | 19 |
2 files changed, 16 insertions, 12 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c288e41ba331..06cbf41d32d2 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -55,7 +55,7 @@ struct kobject { | |||
55 | struct kobject * parent; | 55 | struct kobject * parent; |
56 | struct kset * kset; | 56 | struct kset * kset; |
57 | struct kobj_type * ktype; | 57 | struct kobj_type * ktype; |
58 | struct dentry * dentry; | 58 | struct sysfs_dirent * sd; |
59 | wait_queue_head_t poll; | 59 | wait_queue_head_t poll; |
60 | }; | 60 | }; |
61 | 61 | ||
@@ -71,13 +71,14 @@ extern void kobject_init(struct kobject *); | |||
71 | extern void kobject_cleanup(struct kobject *); | 71 | extern void kobject_cleanup(struct kobject *); |
72 | 72 | ||
73 | extern int __must_check kobject_add(struct kobject *); | 73 | extern int __must_check kobject_add(struct kobject *); |
74 | extern int __must_check kobject_shadow_add(struct kobject *, struct dentry *); | 74 | extern int __must_check kobject_shadow_add(struct kobject *kobj, |
75 | struct sysfs_dirent *shadow_parent); | ||
75 | extern void kobject_del(struct kobject *); | 76 | extern void kobject_del(struct kobject *); |
76 | 77 | ||
77 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); | 78 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); |
78 | extern int __must_check kobject_shadow_rename(struct kobject *kobj, | 79 | extern int __must_check kobject_shadow_rename(struct kobject *kobj, |
79 | struct dentry *new_parent, | 80 | struct sysfs_dirent *new_parent, |
80 | const char *new_name); | 81 | const char *new_name); |
81 | extern int __must_check kobject_move(struct kobject *, struct kobject *); | 82 | extern int __must_check kobject_move(struct kobject *, struct kobject *); |
82 | 83 | ||
83 | extern int __must_check kobject_register(struct kobject *); | 84 | extern int __must_check kobject_register(struct kobject *); |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 2a6df6444e69..4c43030fae5d 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -19,6 +19,7 @@ struct kobject; | |||
19 | struct module; | 19 | struct module; |
20 | struct nameidata; | 20 | struct nameidata; |
21 | struct dentry; | 21 | struct dentry; |
22 | struct sysfs_dirent; | ||
22 | 23 | ||
23 | /* FIXME | 24 | /* FIXME |
24 | * The *owner field is no longer used, but leave around | 25 | * The *owner field is no longer used, but leave around |
@@ -92,13 +93,14 @@ extern int sysfs_schedule_callback(struct kobject *kobj, | |||
92 | void (*func)(void *), void *data, struct module *owner); | 93 | void (*func)(void *), void *data, struct module *owner); |
93 | 94 | ||
94 | extern int __must_check | 95 | extern int __must_check |
95 | sysfs_create_dir(struct kobject *, struct dentry *); | 96 | sysfs_create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent_sd); |
96 | 97 | ||
97 | extern void | 98 | extern void |
98 | sysfs_remove_dir(struct kobject *); | 99 | sysfs_remove_dir(struct kobject *); |
99 | 100 | ||
100 | extern int __must_check | 101 | extern int __must_check |
101 | sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name); | 102 | sysfs_rename_dir(struct kobject *kobj, struct sysfs_dirent *new_parent_sd, |
103 | const char *new_name); | ||
102 | 104 | ||
103 | extern int __must_check | 105 | extern int __must_check |
104 | sysfs_move_dir(struct kobject *, struct kobject *); | 106 | sysfs_move_dir(struct kobject *, struct kobject *); |
@@ -138,8 +140,8 @@ void sysfs_notify(struct kobject * k, char *dir, char *attr); | |||
138 | 140 | ||
139 | extern int sysfs_make_shadowed_dir(struct kobject *kobj, | 141 | extern int sysfs_make_shadowed_dir(struct kobject *kobj, |
140 | void * (*follow_link)(struct dentry *, struct nameidata *)); | 142 | void * (*follow_link)(struct dentry *, struct nameidata *)); |
141 | extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj); | 143 | extern struct sysfs_dirent *sysfs_create_shadow_dir(struct kobject *kobj); |
142 | extern void sysfs_remove_shadow_dir(struct dentry *dir); | 144 | extern void sysfs_remove_shadow_dir(struct sysfs_dirent *shadow_sd); |
143 | 145 | ||
144 | extern int __must_check sysfs_init(void); | 146 | extern int __must_check sysfs_init(void); |
145 | 147 | ||
@@ -151,7 +153,8 @@ static inline int sysfs_schedule_callback(struct kobject *kobj, | |||
151 | return -ENOSYS; | 153 | return -ENOSYS; |
152 | } | 154 | } |
153 | 155 | ||
154 | static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) | 156 | static inline int sysfs_create_dir(struct kobject *kobj, |
157 | struct sysfs_dirent *shadow_parent_sd) | ||
155 | { | 158 | { |
156 | return 0; | 159 | return 0; |
157 | } | 160 | } |
@@ -161,9 +164,9 @@ static inline void sysfs_remove_dir(struct kobject * k) | |||
161 | ; | 164 | ; |
162 | } | 165 | } |
163 | 166 | ||
164 | static inline int sysfs_rename_dir(struct kobject * k, | 167 | static inline int sysfs_rename_dir(struct kobject *kobj, |
165 | struct dentry *new_parent, | 168 | struct sysfs_dirent *new_parent_sd, |
166 | const char *new_name) | 169 | const char *new_name) |
167 | { | 170 | { |
168 | return 0; | 171 | return 0; |
169 | } | 172 | } |