diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 2 | ||||
-rw-r--r-- | fs/partitions/check.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index a02df22f37c3..c982a9107979 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -892,7 +892,7 @@ int check_disk_change(struct block_device *bdev) | |||
892 | 892 | ||
893 | if (bdops->revalidate_disk) | 893 | if (bdops->revalidate_disk) |
894 | bdops->revalidate_disk(bdev->bd_disk); | 894 | bdops->revalidate_disk(bdev->bd_disk); |
895 | if (disk_max_parts(bdev->bd_disk)) | 895 | if (disk_partitionable(bdev->bd_disk)) |
896 | bdev->bd_invalidated = 1; | 896 | bdev->bd_invalidated = 1; |
897 | return 1; | 897 | return 1; |
898 | } | 898 | } |
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index ac0df3acdcda..b60699c271ac 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -173,7 +173,7 @@ check_partition(struct gendisk *hd, struct block_device *bdev) | |||
173 | if (isdigit(state->name[strlen(state->name)-1])) | 173 | if (isdigit(state->name[strlen(state->name)-1])) |
174 | sprintf(state->name, "p"); | 174 | sprintf(state->name, "p"); |
175 | 175 | ||
176 | state->limit = disk_max_parts(hd) + 1; | 176 | state->limit = disk_max_parts(hd); |
177 | i = res = err = 0; | 177 | i = res = err = 0; |
178 | while (!res && check_part[i]) { | 178 | while (!res && check_part[i]) { |
179 | memset(&state->parts, 0, sizeof(state->parts)); | 179 | memset(&state->parts, 0, sizeof(state->parts)); |
@@ -329,12 +329,12 @@ void delete_partition(struct gendisk *disk, int partno) | |||
329 | { | 329 | { |
330 | struct hd_struct *part; | 330 | struct hd_struct *part; |
331 | 331 | ||
332 | part = disk->__part[partno-1]; | 332 | part = disk->__part[partno]; |
333 | if (!part) | 333 | if (!part) |
334 | return; | 334 | return; |
335 | 335 | ||
336 | blk_free_devt(part_devt(part)); | 336 | blk_free_devt(part_devt(part)); |
337 | rcu_assign_pointer(disk->__part[partno-1], NULL); | 337 | rcu_assign_pointer(disk->__part[partno], NULL); |
338 | kobject_put(part->holder_dir); | 338 | kobject_put(part->holder_dir); |
339 | device_del(part_to_dev(part)); | 339 | device_del(part_to_dev(part)); |
340 | 340 | ||
@@ -359,7 +359,7 @@ int add_partition(struct gendisk *disk, int partno, | |||
359 | const char *dname; | 359 | const char *dname; |
360 | int err; | 360 | int err; |
361 | 361 | ||
362 | if (disk->__part[partno - 1]) | 362 | if (disk->__part[partno]) |
363 | return -EBUSY; | 363 | return -EBUSY; |
364 | 364 | ||
365 | p = kzalloc(sizeof(*p), GFP_KERNEL); | 365 | p = kzalloc(sizeof(*p), GFP_KERNEL); |
@@ -413,7 +413,7 @@ int add_partition(struct gendisk *disk, int partno, | |||
413 | 413 | ||
414 | /* everything is up and running, commence */ | 414 | /* everything is up and running, commence */ |
415 | INIT_RCU_HEAD(&p->rcu_head); | 415 | INIT_RCU_HEAD(&p->rcu_head); |
416 | rcu_assign_pointer(disk->__part[partno - 1], p); | 416 | rcu_assign_pointer(disk->__part[partno], p); |
417 | 417 | ||
418 | /* suppress uevent if the disk supresses it */ | 418 | /* suppress uevent if the disk supresses it */ |
419 | if (!ddev->uevent_suppress) | 419 | if (!ddev->uevent_suppress) |
@@ -467,7 +467,7 @@ void register_disk(struct gendisk *disk) | |||
467 | disk_sysfs_add_subdirs(disk); | 467 | disk_sysfs_add_subdirs(disk); |
468 | 468 | ||
469 | /* No minors to use for partitions */ | 469 | /* No minors to use for partitions */ |
470 | if (!disk_max_parts(disk)) | 470 | if (!disk_partitionable(disk)) |
471 | goto exit; | 471 | goto exit; |
472 | 472 | ||
473 | /* No such device (e.g., media were just removed) */ | 473 | /* No such device (e.g., media were just removed) */ |