Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104750
b: refs/heads/master
c: 27f3025
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jul 22, 2008
1 parent 3d0cadd commit 521cad2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 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: 66c64afec16a7b46212ecb2fa99998923bbeea3f
refs/heads/master: 27f302519148f311307637d4c9a6d0fd87d07e4c
25 changes: 13 additions & 12 deletions trunk/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,21 @@ static void *part_start(struct seq_file *part, loff_t *pos)
return NULL;
}

static int find_next(struct device *dev, void *data)
{
if (dev->type == &disk_type)
return 1;
return 0;
}

static void *part_next(struct seq_file *part, void *v, loff_t *pos)
{
struct gendisk *gp = v;
struct device *dev;
++*pos;
list_for_each_entry(dev, &gp->dev.node, node) {
if (&dev->node == &block_class.devices)
return NULL;
if (dev->type == &disk_type)
return dev_to_disk(dev);
}
dev = class_find_device(&block_class, &gp->dev, NULL, find_next);
if (dev)
return dev_to_disk(dev);
return NULL;
}

Expand Down Expand Up @@ -578,12 +582,9 @@ static void *diskstats_next(struct seq_file *part, void *v, loff_t *pos)
struct device *dev;

++*pos;
list_for_each_entry(dev, &gp->dev.node, node) {
if (&dev->node == &block_class.devices)
return NULL;
if (dev->type == &disk_type)
return dev_to_disk(dev);
}
dev = class_find_device(&block_class, &gp->dev, NULL, find_next);
if (dev)
return dev_to_disk(dev);
return NULL;
}

Expand Down

0 comments on commit 521cad2

Please sign in to comment.