* [PATCH] fs/block_dev.c: use list_for_each_entry()
@ 2007-05-30 15:22 Matthias Kaehlcke
0 siblings, 0 replies; only message in thread
From: Matthias Kaehlcke @ 2007-05-30 15:22 UTC (permalink / raw)
To: viro; +Cc: linux-kernel, akpm
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>
--
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 7428992..a63faab 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -590,12 +590,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);
--
Matthias Kaehlcke
Linux Application Developer
Barcelona
If sharing a thing in no way diminishes it,
it is not rightly owned if it is not shared
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-05-30 15:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-30 15:22 [PATCH] fs/block_dev.c: use list_for_each_entry() Matthias Kaehlcke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox