Skip to content

Commit ae45f07

Browse files
committed
quota: Simplify dquot_resume()
We already have quota inode loaded when resuming quotas. Use vfs_load_quota() to avoid some pointless churn with the quota inode. Signed-off-by: Jan Kara <jack@suse.cz>
1 parent c7d3d28 commit ae45f07

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎fs/quota/dquot.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,6 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id,
24382438
int dquot_resume(struct super_block *sb, int type)
24392439
{
24402440
struct quota_info *dqopt = sb_dqopt(sb);
2441-
struct inode *inode;
24422441
int ret = 0, cnt;
24432442
unsigned int flags;
24442443

@@ -2452,8 +2451,6 @@ int dquot_resume(struct super_block *sb, int type)
24522451
if (!sb_has_quota_suspended(sb, cnt))
24532452
continue;
24542453

2455-
inode = dqopt->files[cnt];
2456-
dqopt->files[cnt] = NULL;
24572454
spin_lock(&dq_state_lock);
24582455
flags = dqopt->flags & dquot_state_flag(DQUOT_USAGE_ENABLED |
24592456
DQUOT_LIMITS_ENABLED,
@@ -2462,9 +2459,10 @@ int dquot_resume(struct super_block *sb, int type)
24622459
spin_unlock(&dq_state_lock);
24632460

24642461
flags = dquot_generic_flag(flags, cnt);
2465-
ret = vfs_load_quota_inode(inode, cnt,
2466-
dqopt->info[cnt].dqi_fmt_id, flags);
2467-
iput(inode);
2462+
ret = dquot_load_quota_sb(sb, cnt, dqopt->info[cnt].dqi_fmt_id,
2463+
flags);
2464+
if (ret < 0)
2465+
vfs_cleanup_quota_inode(sb, type);
24682466
}
24692467

24702468
return ret;

0 commit comments

Comments
 (0)