diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-03-20 21:47:52 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-22 16:16:31 -0400 |
commit | 0f4238958d28044b335644b69df6071cdb04b5ce (patch) | |
tree | 159b82f8eb9479cdc10f861d682309b4c0c8c411 /include | |
parent | bbd1ae412c9eb09ae7bb11cfaf7018a2367d493f (diff) |
[SCSI] sysfs: make group is_valid return a mode_t
We have a problem in scsi_transport_spi in that we need to customise
not only the visibility of the attributes, but also their mode. Fix
this by making the is_visible() callback return a mode, with 0
indicating is not visible.
Also add a sysfs_update_group() API to allow us to change either the
visibility or mode of the files at any time on the fly.
Acked-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/sysfs.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 03378e3515b3..add3c5a40827 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -32,7 +32,7 @@ struct attribute { | |||
32 | 32 | ||
33 | struct attribute_group { | 33 | struct attribute_group { |
34 | const char *name; | 34 | const char *name; |
35 | int (*is_visible)(struct kobject *, | 35 | mode_t (*is_visible)(struct kobject *, |
36 | struct attribute *, int); | 36 | struct attribute *, int); |
37 | struct attribute **attrs; | 37 | struct attribute **attrs; |
38 | }; | 38 | }; |
@@ -105,6 +105,8 @@ void sysfs_remove_link(struct kobject *kobj, const char *name); | |||
105 | 105 | ||
106 | int __must_check sysfs_create_group(struct kobject *kobj, | 106 | int __must_check sysfs_create_group(struct kobject *kobj, |
107 | const struct attribute_group *grp); | 107 | const struct attribute_group *grp); |
108 | int sysfs_update_group(struct kobject *kobj, | ||
109 | const struct attribute_group *grp); | ||
108 | void sysfs_remove_group(struct kobject *kobj, | 110 | void sysfs_remove_group(struct kobject *kobj, |
109 | const struct attribute_group *grp); | 111 | const struct attribute_group *grp); |
110 | int sysfs_add_file_to_group(struct kobject *kobj, | 112 | int sysfs_add_file_to_group(struct kobject *kobj, |