We already have quota inode loaded when resuming quotas. Use vfs_load_quota() to avoid some pointless churn with the quota inode.
Unified · Split
| @@ -2438,7 +2438,6 @@ static int vfs_load_quota_inode(struct inode *inode, int type, int format_id, · 2437 unmodified lines | ||
| 2438 | 2438 | int dquot_resume(struct super_block *sb, int type) |
| 2439 | 2439 | { |
| 2440 | 2440 | struct quota_info *dqopt = sb_dqopt(sb); |
| 2441 | − struct inode *inode; | |
| 2442 | 2441 | int ret = 0, cnt; |
| 2443 | 2442 | unsigned int flags; |
| 2444 | 2443 | |
| @@ -2452,8 +2451,6 @@ int dquot_resume(struct super_block *sb, int type) · 7 unmodified lines | ||
| 2452 | 2451 | if (!sb_has_quota_suspended(sb, cnt)) |
| 2453 | 2452 | continue; |
| 2454 | 2453 | |
| 2455 | − inode = dqopt->files[cnt]; | |
| 2456 | − dqopt->files[cnt] = NULL; | |
| 2457 | 2454 | spin_lock(&dq_state_lock); |
| 2458 | 2455 | flags = dqopt->flags & dquot_state_flag(DQUOT_USAGE_ENABLED | |
| 2459 | 2456 | DQUOT_LIMITS_ENABLED, |
| @@ -2462,9 +2459,10 @@ int dquot_resume(struct super_block *sb, int type) · 2 unmodified lines | ||
| 2462 | 2459 | spin_unlock(&dq_state_lock); |
| 2463 | 2460 | |
| 2464 | 2461 | 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); | |
| 2468 | 2466 | } |
| 2469 | 2467 | |
| 2470 | 2468 | return ret; |