[PATCH v5 05/10] fs/quota: convert remove_dquot_ref() to for_each_inode_locked()

From: Huang Shijie

Date: Tue Dec 01 2026 - 01:48:21 EST


Convert remove_dquot_ref() to for_each_inode_locked().

No functional change.

Signed-off-by: Huang Shijie <huangsj@xxxxxxxx>
---
fs/quota/dquot.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index a3d503591871..af32ce73cdd0 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1121,14 +1121,13 @@ static void remove_dquot_ref(struct super_block *sb, int type)
{
struct inode *inode;
#ifdef CONFIG_QUOTA_DEBUG
int reserved = 0;
#endif

- spin_lock(&sb->s_inode_list_lock);
- list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+ for_each_inode_locked(inode, sb) {
/*
* We have to scan also I_NEW inodes because they can already
* have quota pointer initialized. Luckily, we need to touch
* only quota pointers and these have separate locking
* (dq_data_lock).
*/
@@ -1146,13 +1145,12 @@ static void remove_dquot_ref(struct super_block *sb, int type)
rcu_assign_pointer(dquots[type], NULL);
if (dquot)
dqput(dquot);
}
spin_unlock(&dq_data_lock);
}
- spin_unlock(&sb->s_inode_list_lock);
#ifdef CONFIG_QUOTA_DEBUG
if (reserved) {
printk(KERN_WARNING "VFS (%s): Writes happened after quota"
" was disabled thus quota information is probably "
"inconsistent. Please run quotacheck(8).\n", sb->s_id);
}
--
2.34.1