This patch adds an ability to export sysfs attributes below
the block disk device.
This can be used to pass the udev an information about the FTL
and could include the vendor, serial, version, etc...
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
set_disk_ro(gd, 1);
add_disk(gd);
+
+ if (new->disk_attributes)
+ sysfs_create_group(&disk_to_dev(gd)->kobj,
+ new->disk_attributes);
return 0;
error4:
module_put(tr->owner);
/* Stop new requests to arrive */
del_gendisk(old->disk);
+ if (old->disk_attributes)
+ sysfs_remove_group(&disk_to_dev(old->disk)->kobj,
+ old->disk_attributes);
+
/* Stop the thread */
kthread_stop(old->thread);
#include <linux/mutex.h>
#include <linux/kref.h>
+#include <linux/sysfs.h>
struct hd_geometry;
struct mtd_info;
int open;
struct kref ref;
struct gendisk *disk;
+ struct attribute_group *disk_attributes;
struct task_struct *thread;
struct request_queue *rq;
spinlock_t queue_lock;