]> Git Repo - linux.git/commitdiff
block: move header for /proc/partitions to seq_start
authorGreg Kroah-Hartman <[email protected]>
Thu, 22 May 2008 21:21:08 +0000 (17:21 -0400)
committerGreg Kroah-Hartman <[email protected]>
Tue, 22 Jul 2008 04:54:49 +0000 (21:54 -0700)
The seq_start call is the better place for the header for the file, that
way we don't have to be mucking in the class structure to try to figure
out if this is the first partition or not.

Cc: Kay Sievers <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
block/genhd.c

index f03bdadc52ac0488ea227db1eb4651ca94de2e58..70f1d707578310529e375503497c380a9f84a0b8 100644 (file)
@@ -305,6 +305,10 @@ static int find_start(struct device *dev, void *data)
 static void *part_start(struct seq_file *part, loff_t *pos)
 {
        struct device *dev;
+       loff_t n = *pos;
+
+       if (!n)
+               seq_puts(part, "major minor  #blocks  name\n\n");
 
        mutex_lock(&block_class_lock);
        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)
        int n;
        char buf[BDEVNAME_SIZE];
 
-       if (&sgp->dev.node == block_class.devices.next)
-               seq_puts(part, "major minor  #blocks  name\n\n");
-
        /* Don't show non-partitionable removeable devices or empty devices */
        if (!get_capacity(sgp) ||
                        (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE)))
This page took 0.053585 seconds and 4 git commands to generate.