diff options
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r-- | include/linux/sysfs.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index f0496b3d1811..f2694eb4dd3d 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | struct kobject; | 21 | struct kobject; |
22 | struct module; | 22 | struct module; |
23 | enum kobj_ns_type; | ||
23 | 24 | ||
24 | /* FIXME | 25 | /* FIXME |
25 | * The *owner field is no longer used. | 26 | * The *owner field is no longer used. |
@@ -86,17 +87,18 @@ struct attribute_group { | |||
86 | 87 | ||
87 | #define attr_name(_attr) (_attr).attr.name | 88 | #define attr_name(_attr) (_attr).attr.name |
88 | 89 | ||
90 | struct file; | ||
89 | struct vm_area_struct; | 91 | struct vm_area_struct; |
90 | 92 | ||
91 | struct bin_attribute { | 93 | struct bin_attribute { |
92 | struct attribute attr; | 94 | struct attribute attr; |
93 | size_t size; | 95 | size_t size; |
94 | void *private; | 96 | void *private; |
95 | ssize_t (*read)(struct kobject *, struct bin_attribute *, | 97 | ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, |
96 | char *, loff_t, size_t); | 98 | char *, loff_t, size_t); |
97 | ssize_t (*write)(struct kobject *, struct bin_attribute *, | 99 | ssize_t (*write)(struct file *,struct kobject *, struct bin_attribute *, |
98 | char *, loff_t, size_t); | 100 | char *, loff_t, size_t); |
99 | int (*mmap)(struct kobject *, struct bin_attribute *attr, | 101 | int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr, |
100 | struct vm_area_struct *vma); | 102 | struct vm_area_struct *vma); |
101 | }; | 103 | }; |
102 | 104 | ||
@@ -154,6 +156,9 @@ void sysfs_remove_link(struct kobject *kobj, const char *name); | |||
154 | int sysfs_rename_link(struct kobject *kobj, struct kobject *target, | 156 | int sysfs_rename_link(struct kobject *kobj, struct kobject *target, |
155 | const char *old_name, const char *new_name); | 157 | const char *old_name, const char *new_name); |
156 | 158 | ||
159 | void sysfs_delete_link(struct kobject *dir, struct kobject *targ, | ||
160 | const char *name); | ||
161 | |||
157 | int __must_check sysfs_create_group(struct kobject *kobj, | 162 | int __must_check sysfs_create_group(struct kobject *kobj, |
158 | const struct attribute_group *grp); | 163 | const struct attribute_group *grp); |
159 | int sysfs_update_group(struct kobject *kobj, | 164 | int sysfs_update_group(struct kobject *kobj, |
@@ -168,10 +173,15 @@ void sysfs_remove_file_from_group(struct kobject *kobj, | |||
168 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 173 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
169 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | 174 | void sysfs_notify_dirent(struct sysfs_dirent *sd); |
170 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | 175 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, |
176 | const void *ns, | ||
171 | const unsigned char *name); | 177 | const unsigned char *name); |
172 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | 178 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); |
173 | void sysfs_put(struct sysfs_dirent *sd); | 179 | void sysfs_put(struct sysfs_dirent *sd); |
174 | void sysfs_printk_last_file(void); | 180 | void sysfs_printk_last_file(void); |
181 | |||
182 | /* Called to clear a ns tag when it is no longer valid */ | ||
183 | void sysfs_exit_ns(enum kobj_ns_type type, const void *tag); | ||
184 | |||
175 | int __must_check sysfs_init(void); | 185 | int __must_check sysfs_init(void); |
176 | 186 | ||
177 | #else /* CONFIG_SYSFS */ | 187 | #else /* CONFIG_SYSFS */ |
@@ -264,6 +274,11 @@ static inline int sysfs_rename_link(struct kobject *k, struct kobject *t, | |||
264 | return 0; | 274 | return 0; |
265 | } | 275 | } |
266 | 276 | ||
277 | static inline void sysfs_delete_link(struct kobject *k, struct kobject *t, | ||
278 | const char *name) | ||
279 | { | ||
280 | } | ||
281 | |||
267 | static inline int sysfs_create_group(struct kobject *kobj, | 282 | static inline int sysfs_create_group(struct kobject *kobj, |
268 | const struct attribute_group *grp) | 283 | const struct attribute_group *grp) |
269 | { | 284 | { |
@@ -301,6 +316,7 @@ static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | |||
301 | } | 316 | } |
302 | static inline | 317 | static inline |
303 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | 318 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, |
319 | const void *ns, | ||
304 | const unsigned char *name) | 320 | const unsigned char *name) |
305 | { | 321 | { |
306 | return NULL; | 322 | return NULL; |
@@ -313,6 +329,10 @@ static inline void sysfs_put(struct sysfs_dirent *sd) | |||
313 | { | 329 | { |
314 | } | 330 | } |
315 | 331 | ||
332 | static inline void sysfs_exit_ns(int type, const void *tag) | ||
333 | { | ||
334 | } | ||
335 | |||
316 | static inline int __must_check sysfs_init(void) | 336 | static inline int __must_check sysfs_init(void) |
317 | { | 337 | { |
318 | return 0; | 338 | return 0; |