greg@kroah.com [PATCH] Block: move struct disk_attribute to genhd.h ChangeSet 1.2331, 2005/01/14 11:57:48-08:00, greg@kroah.com [PATCH] Block: move struct disk_attribute to genhd.h This allows other block devices to add attributes to their sysfs entries. Signed-off-by: Greg Kroah-Hartman drivers/block/aoe/aoeblk.c | 9 +-------- drivers/block/genhd.c | 6 ------ include/linux/genhd.h | 6 ++++++ 3 files changed, 7 insertions(+), 14 deletions(-) diff -Nru a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c --- a/drivers/block/aoe/aoeblk.c 2005-01-17 13:35:31 -08:00 +++ b/drivers/block/aoe/aoeblk.c 2005-01-17 13:35:31 -08:00 @@ -12,14 +12,7 @@ #include #include "aoe.h" -/* add attributes for our block devices in sysfs - * (see drivers/block/genhd.c:disk_attr_show, etc.) - */ -struct disk_attribute { - struct attribute attr; - ssize_t (*show)(struct gendisk *, char *); -}; - +/* add attributes for our block devices in sysfs */ static ssize_t aoedisk_show_state(struct gendisk * disk, char *page) { struct aoedev *d = disk->private_data; diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c --- a/drivers/block/genhd.c 2005-01-17 13:35:31 -08:00 +++ b/drivers/block/genhd.c 2005-01-17 13:35:31 -08:00 @@ -315,12 +315,6 @@ /* * kobject & sysfs bindings for block devices */ - -struct disk_attribute { - struct attribute attr; - ssize_t (*show)(struct gendisk *, char *); -}; - static ssize_t disk_attr_show(struct kobject *kobj, struct attribute *attr, char *page) { diff -Nru a/include/linux/genhd.h b/include/linux/genhd.h --- a/include/linux/genhd.h 2005-01-17 13:35:31 -08:00 +++ b/include/linux/genhd.h 2005-01-17 13:35:31 -08:00 @@ -128,6 +128,12 @@ #endif }; +/* Structure for sysfs attributes on block devices */ +struct disk_attribute { + struct attribute attr; + ssize_t (*show)(struct gendisk *, char *); +}; + /* * Macros to operate on percpu disk statistics: *