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.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 30b2ebee6439..084354b0e814 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -71,7 +71,8 @@ struct attribute_group {
71 */ 71 */
72 72
73#define __ATTR(_name, _mode, _show, _store) { \ 73#define __ATTR(_name, _mode, _show, _store) { \
74 .attr = {.name = __stringify(_name), .mode = _mode }, \ 74 .attr = {.name = __stringify(_name), \
75 .mode = VERIFY_OCTAL_PERMISSIONS(_mode) }, \
75 .show = _show, \ 76 .show = _show, \
76 .store = _store, \ 77 .store = _store, \
77} 78}
@@ -198,6 +199,7 @@ int __must_check sysfs_chmod_file(struct kobject *kobj,
198 const struct attribute *attr, umode_t mode); 199 const struct attribute *attr, umode_t mode);
199void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, 200void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr,
200 const void *ns); 201 const void *ns);
202bool sysfs_remove_file_self(struct kobject *kobj, const struct attribute *attr);
201void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); 203void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);
202 204
203int __must_check sysfs_create_bin_file(struct kobject *kobj, 205int __must_check sysfs_create_bin_file(struct kobject *kobj,
@@ -246,6 +248,11 @@ void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);
246 248
247int __must_check sysfs_init(void); 249int __must_check sysfs_init(void);
248 250
251static inline void sysfs_enable_ns(struct kernfs_node *kn)
252{
253 return kernfs_enable_ns(kn);
254}
255
249#else /* CONFIG_SYSFS */ 256#else /* CONFIG_SYSFS */
250 257
251static inline int sysfs_schedule_callback(struct kobject *kobj, 258static inline int sysfs_schedule_callback(struct kobject *kobj,
@@ -301,6 +308,12 @@ static inline void sysfs_remove_file_ns(struct kobject *kobj,
301{ 308{
302} 309}
303 310
311static inline bool sysfs_remove_file_self(struct kobject *kobj,
312 const struct attribute *attr)
313{
314 return false;
315}
316
304static inline void sysfs_remove_files(struct kobject *kobj, 317static inline void sysfs_remove_files(struct kobject *kobj,
305 const struct attribute **attr) 318 const struct attribute **attr)
306{ 319{
@@ -418,6 +431,10 @@ static inline int __must_check sysfs_init(void)
418 return 0; 431 return 0;
419} 432}
420 433
434static inline void sysfs_enable_ns(struct kernfs_node *kn)
435{
436}
437
421#endif /* CONFIG_SYSFS */ 438#endif /* CONFIG_SYSFS */
422 439
423static inline int __must_check sysfs_create_file(struct kobject *kobj, 440static inline int __must_check sysfs_create_file(struct kobject *kobj,