Commit 66c64afe authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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 <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 68c4d4a7
......@@ -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");
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 ==
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)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment