aboutsummaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 656c2c7abf99..e0ce23ac2ece 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -190,7 +190,6 @@ void add_disk(struct gendisk *disk)
190 disk->minors, NULL, exact_match, exact_lock, disk); 190 disk->minors, NULL, exact_match, exact_lock, disk);
191 register_disk(disk); 191 register_disk(disk);
192 blk_register_queue(disk); 192 blk_register_queue(disk);
193 blk_register_filter(disk);
194 193
195 bdi = &disk->queue->backing_dev_info; 194 bdi = &disk->queue->backing_dev_info;
196 bdi_register_dev(bdi, MKDEV(disk->major, disk->first_minor)); 195 bdi_register_dev(bdi, MKDEV(disk->major, disk->first_minor));
@@ -203,7 +202,6 @@ EXPORT_SYMBOL(del_gendisk); /* in partitions/check.c */
203 202
204void unlink_gendisk(struct gendisk *disk) 203void unlink_gendisk(struct gendisk *disk)
205{ 204{
206 blk_unregister_filter(disk);
207 sysfs_remove_link(&disk->dev.kobj, "bdi"); 205 sysfs_remove_link(&disk->dev.kobj, "bdi");
208 bdi_unregister(&disk->queue->backing_dev_info); 206 bdi_unregister(&disk->queue->backing_dev_info);
209 blk_unregister_queue(disk); 207 blk_unregister_queue(disk);
@@ -309,7 +307,7 @@ static void *part_start(struct seq_file *part, loff_t *pos)
309 loff_t k = *pos; 307 loff_t k = *pos;
310 308
311 if (!k) 309 if (!k)
312 seq_puts(part, "major minor #blocks name\n\n"); 310 part->private = (void *)1LU; /* tell show to print header */
313 311
314 mutex_lock(&block_class_lock); 312 mutex_lock(&block_class_lock);
315 dev = class_find_device(&block_class, NULL, &k, find_start); 313 dev = class_find_device(&block_class, NULL, &k, find_start);
@@ -351,6 +349,17 @@ static int show_partition(struct seq_file *part, void *v)
351 int n; 349 int n;
352 char buf[BDEVNAME_SIZE]; 350 char buf[BDEVNAME_SIZE];
353 351
352 /*
353 * Print header if start told us to do. This is to preserve
354 * the original behavior of not printing header if no
355 * partition exists. This hackery will be removed later with
356 * class iteration clean up.
357 */
358 if (part->private) {
359 seq_puts(part, "major minor #blocks name\n\n");
360 part->private = NULL;
361 }
362
354 /* Don't show non-partitionable removeable devices or empty devices */ 363 /* Don't show non-partitionable removeable devices or empty devices */
355 if (!get_capacity(sgp) || 364 if (!get_capacity(sgp) ||
356 (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE))) 365 (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE)))