]> git.hungrycats.org Git - linux/commitdiff
Avoid confusion "mount" and "fsck" - don't show things like
authorLinus Torvalds <torvalds@home.transmeta.com>
Sat, 21 Sep 2002 14:19:23 +0000 (07:19 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 21 Sep 2002 14:19:23 +0000 (07:19 -0700)
floppies and CD's in /proc/partitions.

drivers/block/genhd.c

index 37f937d0bef5341b5df1135180cdee8f45260be7..06f86201a42c31a3dfc39339b1c2aab1ba401478 100644 (file)
@@ -174,6 +174,10 @@ static int show_partition(struct seq_file *part, void *v)
        if (sgp == gendisk_head)
                seq_puts(part, "major minor  #blocks  name\n\n");
 
+       /* Don't show non-partitionable devices or empty devices */
+       if (!sgp->minor_shift || !get_capacity(sgp))
+               return 0;
+
        /* show the full disk and all non-0 size partitions of it */
        seq_printf(part, "%4d  %4d %10ld %s\n",
                sgp->major, sgp->first_minor,