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
2438int dquot_resume(struct super_block *sb, int type)2438int dquot_resume(struct super_block *sb, int type)
2439{2439{
2440 struct quota_info *dqopt = sb_dqopt(sb);2440 struct quota_info *dqopt = sb_dqopt(sb);
2441 struct inode *inode;
2442 int ret = 0, cnt;2441 int ret = 0, cnt;
2443 unsigned int flags;2442 unsigned int flags;
2444 2443
@@ -2452,8 +2451,6 @@ int dquot_resume(struct super_block *sb, int type) · 7 unmodified lines
2452 if (!sb_has_quota_suspended(sb, cnt))2451 if (!sb_has_quota_suspended(sb, cnt))
2453 continue;2452 continue;
2454 2453
2455 inode = dqopt->files[cnt];
2456 dqopt->files[cnt] = NULL;
2457 spin_lock(&dq_state_lock);2454 spin_lock(&dq_state_lock);
2458 flags = dqopt->flags & dquot_state_flag(DQUOT_USAGE_ENABLED |2455 flags = dqopt->flags & dquot_state_flag(DQUOT_USAGE_ENABLED |
2459 DQUOT_LIMITS_ENABLED,2456 DQUOT_LIMITS_ENABLED,
@@ -2462,9 +2459,10 @@ int dquot_resume(struct super_block *sb, int type) · 2 unmodified lines
2462 spin_unlock(&dq_state_lock);2459 spin_unlock(&dq_state_lock);
2463 2460
2464 flags = dquot_generic_flag(flags, cnt);2461 flags = dquot_generic_flag(flags, cnt);
2465 ret = vfs_load_quota_inode(inode, cnt,2462 ret = dquot_load_quota_sb(sb, cnt, dqopt->info[cnt].dqi_fmt_id,
2466 dqopt->info[cnt].dqi_fmt_id, flags);2463 flags);
2467 iput(inode);2464 if (ret < 0)
2465 vfs_cleanup_quota_inode(sb, type);
2468 }2466 }
2469 2467
2470 return ret;2468 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