aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 18:49:37 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 18:49:37 -0400
commitefefc6eb38d43b8e5daef482f575d767b002004e (patch)
tree8a3933db1f8721f9bcc9912c800dc8406f4bdf94 /block
parent117494a1b65183f0e3fcc817b07944bc5c465050 (diff)
parentcd59abfcc441b2abb4cf2cd62c1eb0f02a60e8dd (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (75 commits) PM: merge device power-management source files sysfs: add copyrights kobject: update the copyrights kset: add some kerneldoc to help describe what these strange things are Driver core: rename ktype_edd and ktype_efivar Driver core: rename ktype_driver Driver core: rename ktype_device Driver core: rename ktype_class driver core: remove subsystem_init() sysfs: move sysfs file poll implementation to sysfs_open_dirent sysfs: implement sysfs_open_dirent sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir sysfs: make sysfs_root a regular directory dirent sysfs: open code sysfs_attach_dentry() sysfs: make s_elem an anonymous union sysfs: make bin attr open get active reference of parent too sysfs: kill unnecessary NULL pointer check in sysfs_release() sysfs: kill unnecessary sysfs_get() in open paths sysfs: reposition sysfs_dirent->s_mode. sysfs: kill sysfs_update_file() ...
Diffstat (limited to 'block')
-rw-r--r--block/bsg.c5
-rw-r--r--block/elevator.c2
-rw-r--r--block/genhd.c35
-rw-r--r--block/ll_rw_blk.c2
4 files changed, 11 insertions, 33 deletions
diff --git a/block/bsg.c b/block/bsg.c
index ed2646827234..b8ddfc66f210 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -1010,10 +1010,7 @@ unlock:
1010} 1010}
1011EXPORT_SYMBOL_GPL(bsg_register_queue); 1011EXPORT_SYMBOL_GPL(bsg_register_queue);
1012 1012
1013static struct cdev bsg_cdev = { 1013static struct cdev bsg_cdev;
1014 .kobj = {.name = "bsg", },
1015 .owner = THIS_MODULE,
1016};
1017 1014
1018static int __init bsg_init(void) 1015static int __init bsg_init(void)
1019{ 1016{
diff --git a/block/elevator.c b/block/elevator.c
index c6d153de9fd6..b9c518afe1f8 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -186,7 +186,7 @@ static elevator_t *elevator_alloc(struct request_queue *q,
186 eq->ops = &e->ops; 186 eq->ops = &e->ops;
187 eq->elevator_type = e; 187 eq->elevator_type = e;
188 kobject_init(&eq->kobj); 188 kobject_init(&eq->kobj);
189 snprintf(eq->kobj.name, KOBJ_NAME_LEN, "%s", "iosched"); 189 kobject_set_name(&eq->kobj, "%s", "iosched");
190 eq->kobj.ktype = &elv_ktype; 190 eq->kobj.ktype = &elv_ktype;
191 mutex_init(&eq->sysfs_lock); 191 mutex_init(&eq->sysfs_lock);
192 192
diff --git a/block/genhd.c b/block/genhd.c
index 3af1e7a378d4..e609996f2e76 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -540,61 +540,42 @@ static int block_uevent_filter(struct kset *kset, struct kobject *kobj)
540 return ((ktype == &ktype_block) || (ktype == &ktype_part)); 540 return ((ktype == &ktype_block) || (ktype == &ktype_part));
541} 541}
542 542
543static int block_uevent(struct kset *kset, struct kobject *kobj, char **envp, 543static int block_uevent(struct kset *kset, struct kobject *kobj,
544 int num_envp, char *buffer, int buffer_size) 544 struct kobj_uevent_env *env)
545{ 545{
546 struct kobj_type *ktype = get_ktype(kobj); 546 struct kobj_type *ktype = get_ktype(kobj);
547 struct device *physdev; 547 struct device *physdev;
548 struct gendisk *disk; 548 struct gendisk *disk;
549 struct hd_struct *part; 549 struct hd_struct *part;
550 int length = 0;
551 int i = 0;
552 550
553 if (ktype == &ktype_block) { 551 if (ktype == &ktype_block) {
554 disk = container_of(kobj, struct gendisk, kobj); 552 disk = container_of(kobj, struct gendisk, kobj);
555 add_uevent_var(envp, num_envp, &i, buffer, buffer_size, 553 add_uevent_var(env, "MINOR=%u", disk->first_minor);
556 &length, "MINOR=%u", disk->first_minor);
557 } else if (ktype == &ktype_part) { 554 } else if (ktype == &ktype_part) {
558 disk = container_of(kobj->parent, struct gendisk, kobj); 555 disk = container_of(kobj->parent, struct gendisk, kobj);
559 part = container_of(kobj, struct hd_struct, kobj); 556 part = container_of(kobj, struct hd_struct, kobj);
560 add_uevent_var(envp, num_envp, &i, buffer, buffer_size, 557 add_uevent_var(env, "MINOR=%u",
561 &length, "MINOR=%u",
562 disk->first_minor + part->partno); 558 disk->first_minor + part->partno);
563 } else 559 } else
564 return 0; 560 return 0;
565 561
566 add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, 562 add_uevent_var(env, "MAJOR=%u", disk->major);
567 "MAJOR=%u", disk->major);
568 563
569 /* add physical device, backing this device */ 564 /* add physical device, backing this device */
570 physdev = disk->driverfs_dev; 565 physdev = disk->driverfs_dev;
571 if (physdev) { 566 if (physdev) {
572 char *path = kobject_get_path(&physdev->kobj, GFP_KERNEL); 567 char *path = kobject_get_path(&physdev->kobj, GFP_KERNEL);
573 568
574 add_uevent_var(envp, num_envp, &i, buffer, buffer_size, 569 add_uevent_var(env, "PHYSDEVPATH=%s", path);
575 &length, "PHYSDEVPATH=%s", path);
576 kfree(path); 570 kfree(path);
577 571
578 if (physdev->bus) 572 if (physdev->bus)
579 add_uevent_var(envp, num_envp, &i, 573 add_uevent_var(env, "PHYSDEVBUS=%s", physdev->bus->name);
580 buffer, buffer_size, &length,
581 "PHYSDEVBUS=%s",
582 physdev->bus->name);
583 574
584 if (physdev->driver) 575 if (physdev->driver)
585 add_uevent_var(envp, num_envp, &i, 576 add_uevent_var(env, physdev->driver->name);
586 buffer, buffer_size, &length,
587 "PHYSDEVDRIVER=%s",
588 physdev->driver->name);
589 } 577 }
590 578
591 /* terminate, set to next free slot, shrink available space */
592 envp[i] = NULL;
593 envp = &envp[i];
594 num_envp -= i;
595 buffer = &buffer[length];
596 buffer_size -= length;
597
598 return 0; 579 return 0;
599} 580}
600 581
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index cd9d2c5d91ae..d875673e76cd 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1854,7 +1854,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
1854 1854
1855 init_timer(&q->unplug_timer); 1855 init_timer(&q->unplug_timer);
1856 1856
1857 snprintf(q->kobj.name, KOBJ_NAME_LEN, "%s", "queue"); 1857 kobject_set_name(&q->kobj, "%s", "queue");
1858 q->kobj.ktype = &queue_ktype; 1858 q->kobj.ktype = &queue_ktype;
1859 kobject_init(&q->kobj); 1859 kobject_init(&q->kobj);
1860 1860