aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/genhd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c
index f03bdadc52ac..70f1d7075783 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -305,6 +305,10 @@ static int find_start(struct device *dev, void *data)
305static void *part_start(struct seq_file *part, loff_t *pos) 305static void *part_start(struct seq_file *part, loff_t *pos)
306{ 306{
307 struct device *dev; 307 struct device *dev;
308 loff_t n = *pos;
309
310 if (!n)
311 seq_puts(part, "major minor #blocks name\n\n");
308 312
309 mutex_lock(&block_class_lock); 313 mutex_lock(&block_class_lock);
310 dev = class_find_device(&block_class, NULL, (void *)pos, find_start); 314 dev = class_find_device(&block_class, NULL, (void *)pos, find_start);
@@ -338,9 +342,6 @@ static int show_partition(struct seq_file *part, void *v)
338 int n; 342 int n;
339 char buf[BDEVNAME_SIZE]; 343 char buf[BDEVNAME_SIZE];
340 344
341 if (&sgp->dev.node == block_class.devices.next)
342 seq_puts(part, "major minor #blocks name\n\n");
343
344 /* Don't show non-partitionable removeable devices or empty devices */ 345 /* Don't show non-partitionable removeable devices or empty devices */
345 if (!get_capacity(sgp) || 346 if (!get_capacity(sgp) ||
346 (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE))) 347 (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE)))