Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109359
b: refs/heads/master
c: ddef43a
h: refs/heads/master
i:
  109357: e9a74f9
  109355: a35c288
  109351: 96cf969
  109343: 89aaabd
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Sep 1, 2008
1 parent f3e7323 commit c5c8150
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb23b431db7405f6d79f989ad0236bf6428ba1cb
refs/heads/master: ddef43a843f620c6742a06633739887a901ec06b
13 changes: 12 additions & 1 deletion trunk/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ static void *part_start(struct seq_file *part, loff_t *pos)
loff_t k = *pos;

if (!k)
seq_puts(part, "major minor #blocks name\n\n");
part->private = (void *)1LU; /* tell show to print header */

mutex_lock(&block_class_lock);
dev = class_find_device(&block_class, NULL, &k, find_start);
Expand Down Expand Up @@ -349,6 +349,17 @@ static int show_partition(struct seq_file *part, void *v)
int n;
char buf[BDEVNAME_SIZE];

/*
* Print header if start told us to do. This is to preserve
* the original behavior of not printing header if no
* partition exists. This hackery will be removed later with
* class iteration clean up.
*/
if (part->private) {
seq_puts(part, "major minor #blocks name\n\n");
part->private = NULL;
}

/* Don't show non-partitionable removeable devices or empty devices */
if (!get_capacity(sgp) ||
(sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE)))
Expand Down

0 comments on commit c5c8150

Please sign in to comment.