summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-05-22 17:21:08 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2008-06-05 10:45:31 +1000
commit1924d3c15398fdb30a4c8161ff126eb326cbc1ab (patch)
tree96150d808a8d8bb6cd75ac37566a17b5609d339d /block
parent1792c2ee460cfd6b54f620a61365b2e28f95863c (diff)
block: move header for /proc/partitions to seq_start
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 <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 07ab9a82cbcd..23ff7d1a2416 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -303,6 +303,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);
@@ -336,9 +340,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)))