History

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.

Jan Kara committed 7 years ago

Commit ae45f071 parent c7d3d281 file · +4 −6Browse files

Unified · Split

fs/quota/dquot.c+4−6
@@ -2438,7 +2438,6 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id, · 2437 unmodified lines
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) · 7 unmodified lines
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) · 2 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t