mtd: blktrans: allow FTL drivers to export sysfs attributes
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>
This commit is contained in:
committed by
David Woodhouse
parent
75c0b84d41
commit
026ec57886
@@ -379,6 +379,10 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
|
||||
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);
|
||||
@@ -405,6 +409,10 @@ int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old)
|
||||
/* 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);
|
||||
|
||||
|
Reference in New Issue
Block a user