Skip to content

Commit

Permalink
fs/block_dev.c: use list_for_each_entry()
Browse files Browse the repository at this point in the history
fs/block_dev.c: Use list_for_each_entry() instead of list_for_each()
in nr_blockdev_pages()

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Matthias Kaehlcke authored and Linus Torvalds committed Jul 16, 2007
1 parent 00c5746 commit 203a293
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,12 +588,10 @@ EXPORT_SYMBOL(bdget);

long nr_blockdev_pages(void)
{
struct list_head *p;
struct block_device *bdev;
long ret = 0;
spin_lock(&bdev_lock);
list_for_each(p, &all_bdevs) {
struct block_device *bdev;
bdev = list_entry(p, struct block_device, bd_list);
list_for_each_entry(bdev, &all_bdevs, bd_list) {
ret += bdev->bd_inode->i_mapping->nrpages;
}
spin_unlock(&bdev_lock);
Expand Down

0 comments on commit 203a293

Please sign in to comment.