Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6:
Driver core: struct class remove children list
block: do_mounts - accept root=<non-existant partition>

+34 -8
+6 -3
block/genhd.c
··· 653 EXPORT_SYMBOL_GPL(genhd_media_change_notify); 654 #endif /* 0 */ 655 656 - dev_t blk_lookup_devt(const char *name) 657 { 658 struct device *dev; 659 dev_t devt = MKDEV(0, 0); ··· 661 mutex_lock(&block_class_lock); 662 list_for_each_entry(dev, &block_class.devices, node) { 663 if (strcmp(dev->bus_id, name) == 0) { 664 - devt = dev->devt; 665 break; 666 } 667 } ··· 673 674 return devt; 675 } 676 - 677 EXPORT_SYMBOL(blk_lookup_devt); 678 679 struct gendisk *alloc_disk(int minors)
··· 653 EXPORT_SYMBOL_GPL(genhd_media_change_notify); 654 #endif /* 0 */ 655 656 + dev_t blk_lookup_devt(const char *name, int part) 657 { 658 struct device *dev; 659 dev_t devt = MKDEV(0, 0); ··· 661 mutex_lock(&block_class_lock); 662 list_for_each_entry(dev, &block_class.devices, node) { 663 if (strcmp(dev->bus_id, name) == 0) { 664 + struct gendisk *disk = dev_to_disk(dev); 665 + 666 + if (part < disk->minors) 667 + devt = MKDEV(MAJOR(dev->devt), 668 + MINOR(dev->devt) + part); 669 break; 670 } 671 } ··· 669 670 return devt; 671 } 672 EXPORT_SYMBOL(blk_lookup_devt); 673 674 struct gendisk *alloc_disk(int minors)
-1
drivers/base/class.c
··· 140 141 pr_debug("device class '%s': registering\n", cls->name); 142 143 - INIT_LIST_HEAD(&cls->children); 144 INIT_LIST_HEAD(&cls->devices); 145 INIT_LIST_HEAD(&cls->interfaces); 146 kset_init(&cls->class_dirs);
··· 140 141 pr_debug("device class '%s': registering\n", cls->name); 142 143 INIT_LIST_HEAD(&cls->devices); 144 INIT_LIST_HEAD(&cls->interfaces); 145 kset_init(&cls->class_dirs);
-1
include/linux/device.h
··· 183 struct module *owner; 184 185 struct kset subsys; 186 - struct list_head children; 187 struct list_head devices; 188 struct list_head interfaces; 189 struct kset class_dirs;
··· 183 struct module *owner; 184 185 struct kset subsys; 186 struct list_head devices; 187 struct list_head interfaces; 188 struct kset class_dirs;
+2 -2
include/linux/genhd.h
··· 525 #define ADDPART_FLAG_RAID 1 526 #define ADDPART_FLAG_WHOLEDISK 2 527 528 - extern dev_t blk_lookup_devt(const char *name); 529 extern char *disk_name (struct gendisk *hd, int part, char *buf); 530 531 extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); ··· 553 554 static inline void printk_all_partitions(void) { } 555 556 - static inline dev_t blk_lookup_devt(const char *name) 557 { 558 dev_t devt = MKDEV(0, 0); 559 return devt;
··· 525 #define ADDPART_FLAG_RAID 1 526 #define ADDPART_FLAG_WHOLEDISK 2 527 528 + extern dev_t blk_lookup_devt(const char *name, int part); 529 extern char *disk_name (struct gendisk *hd, int part, char *buf); 530 531 extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); ··· 553 554 static inline void printk_all_partitions(void) { } 555 556 + static inline dev_t blk_lookup_devt(const char *name, int part) 557 { 558 dev_t devt = MKDEV(0, 0); 559 return devt;
+26 -1
init/do_mounts.c
··· 76 char s[32]; 77 char *p; 78 dev_t res = 0; 79 80 if (strncmp(name, "/dev/", 5) != 0) { 81 unsigned maj, min; ··· 107 for (p = s; *p; p++) 108 if (*p == '/') 109 *p = '!'; 110 - res = blk_lookup_devt(s); 111 if (res) 112 goto done; 113
··· 76 char s[32]; 77 char *p; 78 dev_t res = 0; 79 + int part; 80 81 if (strncmp(name, "/dev/", 5) != 0) { 82 unsigned maj, min; ··· 106 for (p = s; *p; p++) 107 if (*p == '/') 108 *p = '!'; 109 + res = blk_lookup_devt(s, 0); 110 + if (res) 111 + goto done; 112 + 113 + /* 114 + * try non-existant, but valid partition, which may only exist 115 + * after revalidating the disk, like partitioned md devices 116 + */ 117 + while (p > s && isdigit(p[-1])) 118 + p--; 119 + if (p == s || !*p || *p == '0') 120 + goto fail; 121 + 122 + /* try disk name without <part number> */ 123 + part = simple_strtoul(p, NULL, 10); 124 + *p = '\0'; 125 + res = blk_lookup_devt(s, part); 126 + if (res) 127 + goto done; 128 + 129 + /* try disk name without p<part number> */ 130 + if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p') 131 + goto fail; 132 + p[-1] = '\0'; 133 + res = blk_lookup_devt(s, part); 134 if (res) 135 goto done; 136