diff options
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r-- | include/linux/sysfs.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 9f65758311a4..c6f0f0d0e17e 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -64,10 +64,18 @@ do { \ | |||
64 | * a new subdirectory with this name. | 64 | * a new subdirectory with this name. |
65 | * @is_visible: Optional: Function to return permissions associated with an | 65 | * @is_visible: Optional: Function to return permissions associated with an |
66 | * attribute of the group. Will be called repeatedly for each | 66 | * attribute of the group. Will be called repeatedly for each |
67 | * attribute in the group. Only read/write permissions as well as | 67 | * non-binary attribute in the group. Only read/write |
68 | * SYSFS_PREALLOC are accepted. Must return 0 if an attribute is | 68 | * permissions as well as SYSFS_PREALLOC are accepted. Must |
69 | * not visible. The returned value will replace static permissions | 69 | * return 0 if an attribute is not visible. The returned value |
70 | * defined in struct attribute or struct bin_attribute. | 70 | * will replace static permissions defined in struct attribute. |
71 | * @is_bin_visible: | ||
72 | * Optional: Function to return permissions associated with a | ||
73 | * binary attribute of the group. Will be called repeatedly | ||
74 | * for each binary attribute in the group. Only read/write | ||
75 | * permissions as well as SYSFS_PREALLOC are accepted. Must | ||
76 | * return 0 if a binary attribute is not visible. The returned | ||
77 | * value will replace static permissions defined in | ||
78 | * struct bin_attribute. | ||
71 | * @attrs: Pointer to NULL terminated list of attributes. | 79 | * @attrs: Pointer to NULL terminated list of attributes. |
72 | * @bin_attrs: Pointer to NULL terminated list of binary attributes. | 80 | * @bin_attrs: Pointer to NULL terminated list of binary attributes. |
73 | * Either attrs or bin_attrs or both must be provided. | 81 | * Either attrs or bin_attrs or both must be provided. |
@@ -76,6 +84,8 @@ struct attribute_group { | |||
76 | const char *name; | 84 | const char *name; |
77 | umode_t (*is_visible)(struct kobject *, | 85 | umode_t (*is_visible)(struct kobject *, |
78 | struct attribute *, int); | 86 | struct attribute *, int); |
87 | umode_t (*is_bin_visible)(struct kobject *, | ||
88 | struct bin_attribute *, int); | ||
79 | struct attribute **attrs; | 89 | struct attribute **attrs; |
80 | struct bin_attribute **bin_attrs; | 90 | struct bin_attribute **bin_attrs; |
81 | }; | 91 | }; |
@@ -268,6 +278,9 @@ int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name, | |||
268 | struct kobject *target, const char *link_name); | 278 | struct kobject *target, const char *link_name); |
269 | void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, | 279 | void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, |
270 | const char *link_name); | 280 | const char *link_name); |
281 | int __compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj, | ||
282 | struct kobject *target_kobj, | ||
283 | const char *target_name); | ||
271 | 284 | ||
272 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 285 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
273 | 286 | ||
@@ -451,6 +464,14 @@ static inline void sysfs_remove_link_from_group(struct kobject *kobj, | |||
451 | { | 464 | { |
452 | } | 465 | } |
453 | 466 | ||
467 | static inline int __compat_only_sysfs_link_entry_to_kobj( | ||
468 | struct kobject *kobj, | ||
469 | struct kobject *target_kobj, | ||
470 | const char *target_name) | ||
471 | { | ||
472 | return 0; | ||
473 | } | ||
474 | |||
454 | static inline void sysfs_notify(struct kobject *kobj, const char *dir, | 475 | static inline void sysfs_notify(struct kobject *kobj, const char *dir, |
455 | const char *attr) | 476 | const char *attr) |
456 | { | 477 | { |