Commit bac95f08 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] Block: move struct disk_attribute to genhd.h

This allows other block devices to add attributes to their sysfs
entries.
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent c5367bd0
......@@ -12,14 +12,7 @@
#include <linux/netdevice.h>
#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;
......
......@@ -315,12 +315,6 @@ subsys_initcall(device_init);
/*
* 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)
{
......
......@@ -128,6 +128,12 @@ struct gendisk {
#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:
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment