[PATCH 05/11] fs: use sb_for_each_inodes_safe API
Ye Bin
yebin at huaweicloud.com
Mon Nov 18 11:45:02 UTC 2024
From: Ye Bin <yebin10 at huawei.com>
Use sb_for_each_inodes_safe API foreach super_block->s_inodes.
Signed-off-by: Ye Bin <yebin10 at huawei.com>
---
fs/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/inode.c b/fs/inode.c
index e5a60084a7a9..dc966990bda6 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -861,7 +861,7 @@ void evict_inodes(struct super_block *sb)
again:
spin_lock(&sb->s_inode_list_lock);
- list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) {
+ sb_for_each_inodes_safe(inode, next, &sb->s_inodes) {
if (atomic_read(&inode->i_count))
continue;
@@ -911,7 +911,7 @@ void invalidate_inodes(struct super_block *sb)
again:
spin_lock(&sb->s_inode_list_lock);
- list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) {
+ sb_for_each_inodes_safe(inode, next, &sb->s_inodes) {
spin_lock(&inode->i_lock);
if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) {
spin_unlock(&inode->i_lock);
--
2.34.1
More information about the Linux-security-module-archive
mailing list