[PATCH 02/11] block: use sb_for_each_inodes API
Ye Bin
yebin at huaweicloud.com
Mon Nov 18 11:44:59 UTC 2024
From: Ye Bin <yebin10 at huawei.com>
Use sb_for_each_inodes API foreach super_block->s_inodes.
Signed-off-by: Ye Bin <yebin10 at huawei.com>
---
block/bdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/bdev.c b/block/bdev.c
index 738e3c8457e7..b29e2c5c7c6e 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -478,7 +478,7 @@ long nr_blockdev_pages(void)
long ret = 0;
spin_lock(&blockdev_superblock->s_inode_list_lock);
- list_for_each_entry(inode, &blockdev_superblock->s_inodes, i_sb_list)
+ sb_for_each_inodes(inode, &blockdev_superblock->s_inodes)
ret += inode->i_mapping->nrpages;
spin_unlock(&blockdev_superblock->s_inode_list_lock);
@@ -1219,7 +1219,7 @@ void sync_bdevs(bool wait)
struct inode *inode, *old_inode = NULL;
spin_lock(&blockdev_superblock->s_inode_list_lock);
- list_for_each_entry(inode, &blockdev_superblock->s_inodes, i_sb_list) {
+ sb_for_each_inodes(inode, &blockdev_superblock->s_inodes) {
struct address_space *mapping = inode->i_mapping;
struct block_device *bdev;
--
2.34.1
More information about the Linux-security-module-archive
mailing list