aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r--include/linux/sysfs.h26
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
21struct kobject; 21struct kobject;
22struct module; 22struct module;
23enum 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
90struct file;
89struct vm_area_struct; 91struct vm_area_struct;
90 92
91struct bin_attribute { 93struct 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);
154int sysfs_rename_link(struct kobject *kobj, struct kobject *target, 156int 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
159void sysfs_delete_link(struct kobject *dir, struct kobject *targ,
160 const char *name);
161
157int __must_check sysfs_create_group(struct kobject *kobj, 162int __must_check sysfs_create_group(struct kobject *kobj,
158 const struct attribute_group *grp); 163 const struct attribute_group *grp);
159int sysfs_update_group(struct kobject *kobj, 164int sysfs_update_group(struct kobject *kobj,
@@ -168,10 +173,15 @@ void sysfs_remove_file_from_group(struct kobject *kobj,
168void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); 173void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);
169void sysfs_notify_dirent(struct sysfs_dirent *sd); 174void sysfs_notify_dirent(struct sysfs_dirent *sd);
170struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, 175struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
176 const void *ns,
171 const unsigned char *name); 177 const unsigned char *name);
172struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); 178struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
173void sysfs_put(struct sysfs_dirent *sd); 179void sysfs_put(struct sysfs_dirent *sd);
174void sysfs_printk_last_file(void); 180void sysfs_printk_last_file(void);
181
182/* Called to clear a ns tag when it is no longer valid */
183void sysfs_exit_ns(enum kobj_ns_type type, const void *tag);
184
175int __must_check sysfs_init(void); 185int __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
277static inline void sysfs_delete_link(struct kobject *k, struct kobject *t,
278 const char *name)
279{
280}
281
267static inline int sysfs_create_group(struct kobject *kobj, 282static 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}
302static inline 317static inline
303struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, 318struct 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
332static inline void sysfs_exit_ns(int type, const void *tag)
333{
334}
335
316static inline int __must_check sysfs_init(void) 336static inline int __must_check sysfs_init(void)
317{ 337{
318 return 0; 338 return 0;