diff options
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r-- | include/linux/sysfs.h | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index f0496b3d1811..96eb576d82fd 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -16,19 +16,15 @@ | |||
16 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/lockdep.h> | 18 | #include <linux/lockdep.h> |
19 | #include <linux/kobject_ns.h> | ||
19 | #include <asm/atomic.h> | 20 | #include <asm/atomic.h> |
20 | 21 | ||
21 | struct kobject; | 22 | struct kobject; |
22 | struct module; | 23 | struct module; |
24 | enum kobj_ns_type; | ||
23 | 25 | ||
24 | /* FIXME | ||
25 | * The *owner field is no longer used. | ||
26 | * x86 tree has been cleaned up. The owner | ||
27 | * attribute is still left for other arches. | ||
28 | */ | ||
29 | struct attribute { | 26 | struct attribute { |
30 | const char *name; | 27 | const char *name; |
31 | struct module *owner; | ||
32 | mode_t mode; | 28 | mode_t mode; |
33 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 29 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
34 | struct lock_class_key *key; | 30 | struct lock_class_key *key; |
@@ -86,17 +82,18 @@ struct attribute_group { | |||
86 | 82 | ||
87 | #define attr_name(_attr) (_attr).attr.name | 83 | #define attr_name(_attr) (_attr).attr.name |
88 | 84 | ||
85 | struct file; | ||
89 | struct vm_area_struct; | 86 | struct vm_area_struct; |
90 | 87 | ||
91 | struct bin_attribute { | 88 | struct bin_attribute { |
92 | struct attribute attr; | 89 | struct attribute attr; |
93 | size_t size; | 90 | size_t size; |
94 | void *private; | 91 | void *private; |
95 | ssize_t (*read)(struct kobject *, struct bin_attribute *, | 92 | ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, |
96 | char *, loff_t, size_t); | 93 | char *, loff_t, size_t); |
97 | ssize_t (*write)(struct kobject *, struct bin_attribute *, | 94 | ssize_t (*write)(struct file *,struct kobject *, struct bin_attribute *, |
98 | char *, loff_t, size_t); | 95 | char *, loff_t, size_t); |
99 | int (*mmap)(struct kobject *, struct bin_attribute *attr, | 96 | int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr, |
100 | struct vm_area_struct *vma); | 97 | struct vm_area_struct *vma); |
101 | }; | 98 | }; |
102 | 99 | ||
@@ -134,8 +131,8 @@ int __must_check sysfs_create_file(struct kobject *kobj, | |||
134 | const struct attribute *attr); | 131 | const struct attribute *attr); |
135 | int __must_check sysfs_create_files(struct kobject *kobj, | 132 | int __must_check sysfs_create_files(struct kobject *kobj, |
136 | const struct attribute **attr); | 133 | const struct attribute **attr); |
137 | int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, | 134 | int __must_check sysfs_chmod_file(struct kobject *kobj, |
138 | mode_t mode); | 135 | const struct attribute *attr, mode_t mode); |
139 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); | 136 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); |
140 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); | 137 | void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); |
141 | 138 | ||
@@ -154,6 +151,9 @@ void sysfs_remove_link(struct kobject *kobj, const char *name); | |||
154 | int sysfs_rename_link(struct kobject *kobj, struct kobject *target, | 151 | int sysfs_rename_link(struct kobject *kobj, struct kobject *target, |
155 | const char *old_name, const char *new_name); | 152 | const char *old_name, const char *new_name); |
156 | 153 | ||
154 | void sysfs_delete_link(struct kobject *dir, struct kobject *targ, | ||
155 | const char *name); | ||
156 | |||
157 | int __must_check sysfs_create_group(struct kobject *kobj, | 157 | int __must_check sysfs_create_group(struct kobject *kobj, |
158 | const struct attribute_group *grp); | 158 | const struct attribute_group *grp); |
159 | int sysfs_update_group(struct kobject *kobj, | 159 | int sysfs_update_group(struct kobject *kobj, |
@@ -168,10 +168,15 @@ void sysfs_remove_file_from_group(struct kobject *kobj, | |||
168 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 168 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
169 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | 169 | void sysfs_notify_dirent(struct sysfs_dirent *sd); |
170 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | 170 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, |
171 | const void *ns, | ||
171 | const unsigned char *name); | 172 | const unsigned char *name); |
172 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); | 173 | struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); |
173 | void sysfs_put(struct sysfs_dirent *sd); | 174 | void sysfs_put(struct sysfs_dirent *sd); |
174 | void sysfs_printk_last_file(void); | 175 | void sysfs_printk_last_file(void); |
176 | |||
177 | /* Called to clear a ns tag when it is no longer valid */ | ||
178 | void sysfs_exit_ns(enum kobj_ns_type type, const void *tag); | ||
179 | |||
175 | int __must_check sysfs_init(void); | 180 | int __must_check sysfs_init(void); |
176 | 181 | ||
177 | #else /* CONFIG_SYSFS */ | 182 | #else /* CONFIG_SYSFS */ |
@@ -215,7 +220,7 @@ static inline int sysfs_create_files(struct kobject *kobj, | |||
215 | } | 220 | } |
216 | 221 | ||
217 | static inline int sysfs_chmod_file(struct kobject *kobj, | 222 | static inline int sysfs_chmod_file(struct kobject *kobj, |
218 | struct attribute *attr, mode_t mode) | 223 | const struct attribute *attr, mode_t mode) |
219 | { | 224 | { |
220 | return 0; | 225 | return 0; |
221 | } | 226 | } |
@@ -264,6 +269,11 @@ static inline int sysfs_rename_link(struct kobject *k, struct kobject *t, | |||
264 | return 0; | 269 | return 0; |
265 | } | 270 | } |
266 | 271 | ||
272 | static inline void sysfs_delete_link(struct kobject *k, struct kobject *t, | ||
273 | const char *name) | ||
274 | { | ||
275 | } | ||
276 | |||
267 | static inline int sysfs_create_group(struct kobject *kobj, | 277 | static inline int sysfs_create_group(struct kobject *kobj, |
268 | const struct attribute_group *grp) | 278 | const struct attribute_group *grp) |
269 | { | 279 | { |
@@ -301,6 +311,7 @@ static inline void sysfs_notify_dirent(struct sysfs_dirent *sd) | |||
301 | } | 311 | } |
302 | static inline | 312 | static inline |
303 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, | 313 | struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, |
314 | const void *ns, | ||
304 | const unsigned char *name) | 315 | const unsigned char *name) |
305 | { | 316 | { |
306 | return NULL; | 317 | return NULL; |
@@ -313,6 +324,10 @@ static inline void sysfs_put(struct sysfs_dirent *sd) | |||
313 | { | 324 | { |
314 | } | 325 | } |
315 | 326 | ||
327 | static inline void sysfs_exit_ns(int type, const void *tag) | ||
328 | { | ||
329 | } | ||
330 | |||
316 | static inline int __must_check sysfs_init(void) | 331 | static inline int __must_check sysfs_init(void) |
317 | { | 332 | { |
318 | return 0; | 333 | return 0; |