Newsgroups: fa.linux.kernel
From: Malcolm Rowe <malcolm-li...@farside.org.uk>
Date: Sat, 19 Feb 2005 23:30:53 GMT
Local: Sat, Feb 19 2005 6:30 pm
Subject: [PATCH] Symlink /sys/class/block to /sys/block
Greg,
Following the discussion in [1], the attached patch creates /sys/class/block Please cc: me on any replies - I'm not subscribed to the mailing list. [1] http://marc.theaimsgroup.com/?m=110506536315986 Regards, Signed-off-by: Malcolm Rowe <malcolm-li...@farside.org.uk> diff -ur linux-2.6.11-rc4-bk7/drivers/base/class.c }; /* Hotplug events for classes go to the class_obj subsys */ -static decl_subsys(class, &ktype_class, NULL); +decl_subsys(class, &ktype_class, NULL); int class_create_file(struct class * cls, const struct class_attribute * #define MAX_PROBE_HASH 255 /* random */ @@ -300,11 +301,24 @@ } +extern struct subsystem class_subsys; + static int __init genhd_device_init(void) { bdev_map = kobj_map_init(base_probe, &block_subsys); blk_dev_init(); - subsystem_register(&block_subsys); + if (!subsystem_register(&block_subsys)) { + /* + * /sys/block should really live under /sys/class, but for + * the moment, we can only have class devices, not + * sub-classes-devices. Until we can move /sys/block into + * the right place, create a symlink from /sys/class/block to + * /sys/block, so that userspace doesn't need to know about + * the difference. + */ + sysfs_create_link(&class_subsys.kset.kobj, + &block_subsys.kset.kobj, "block"); + } return 0; } @@ -406,6 +420,7 @@ static void disk_release(struct kobject * kobj) { struct gendisk *disk = to_disk(kobj); + sysfs_remove_link(&class_subsys.kset.kobj, "block"); kfree(disk->random); kfree(disk->part); free_disk_stats(disk); - You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||