diff options
| author | Jan Kara <jack@suse.cz> | 2012-04-25 15:10:31 -0400 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2012-05-15 17:34:39 -0400 |
| commit | f9ef178412cab442719c9ffdc659933f5f2fa87e (patch) | |
| tree | fd80b46cb8ac04c97a0df67063fa27a86042298d | |
| parent | e2a3fde75079efeb22cf1e5098d5689b664bf1d5 (diff) | |
quota: Use precomputed value of sb_dqopt in dquot_quota_sync
Signed-off-by: Jan Kara <jack@suse.cz>
| -rw-r--r-- | fs/quota/dquot.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 0dcdda305c99..6e429fdda17d 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
| @@ -638,7 +638,7 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait) | |||
| 638 | dqstats_inc(DQST_SYNCS); | 638 | dqstats_inc(DQST_SYNCS); |
| 639 | mutex_unlock(&dqopt->dqonoff_mutex); | 639 | mutex_unlock(&dqopt->dqonoff_mutex); |
| 640 | 640 | ||
| 641 | if (!wait || (sb_dqopt(sb)->flags & DQUOT_QUOTA_SYS_FILE)) | 641 | if (!wait || (dqopt->flags & DQUOT_QUOTA_SYS_FILE)) |
| 642 | return 0; | 642 | return 0; |
| 643 | 643 | ||
| 644 | /* This is not very clever (and fast) but currently I don't know about | 644 | /* This is not very clever (and fast) but currently I don't know about |
| @@ -652,18 +652,18 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait) | |||
| 652 | * Now when everything is written we can discard the pagecache so | 652 | * Now when everything is written we can discard the pagecache so |
| 653 | * that userspace sees the changes. | 653 | * that userspace sees the changes. |
| 654 | */ | 654 | */ |
| 655 | mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); | 655 | mutex_lock(&dqopt->dqonoff_mutex); |
| 656 | for (cnt = 0; cnt < MAXQUOTAS; cnt++) { | 656 | for (cnt = 0; cnt < MAXQUOTAS; cnt++) { |
| 657 | if (type != -1 && cnt != type) | 657 | if (type != -1 && cnt != type) |
| 658 | continue; | 658 | continue; |
| 659 | if (!sb_has_quota_active(sb, cnt)) | 659 | if (!sb_has_quota_active(sb, cnt)) |
| 660 | continue; | 660 | continue; |
| 661 | mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex, | 661 | mutex_lock_nested(&dqopt->files[cnt]->i_mutex, |
| 662 | I_MUTEX_QUOTA); | 662 | I_MUTEX_QUOTA); |
| 663 | truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0); | 663 | truncate_inode_pages(&dqopt->files[cnt]->i_data, 0); |
| 664 | mutex_unlock(&sb_dqopt(sb)->files[cnt]->i_mutex); | 664 | mutex_unlock(&dqopt->files[cnt]->i_mutex); |
| 665 | } | 665 | } |
| 666 | mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); | 666 | mutex_unlock(&dqopt->dqonoff_mutex); |
| 667 | 667 | ||
| 668 | return 0; | 668 | return 0; |
| 669 | } | 669 | } |
