Commit f9ef1784 authored by Jan Kara's avatar Jan Kara

quota: Use precomputed value of sb_dqopt in dquot_quota_sync

Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent e2a3fde7
...@@ -638,7 +638,7 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait) ...@@ -638,7 +638,7 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait)
dqstats_inc(DQST_SYNCS); dqstats_inc(DQST_SYNCS);
mutex_unlock(&dqopt->dqonoff_mutex); mutex_unlock(&dqopt->dqonoff_mutex);
if (!wait || (sb_dqopt(sb)->flags & DQUOT_QUOTA_SYS_FILE)) if (!wait || (dqopt->flags & DQUOT_QUOTA_SYS_FILE))
return 0; return 0;
/* This is not very clever (and fast) but currently I don't know about /* 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,18 +652,18 @@ int dquot_quota_sync(struct super_block *sb, int type, int wait)
* Now when everything is written we can discard the pagecache so * Now when everything is written we can discard the pagecache so
* that userspace sees the changes. * that userspace sees the changes.
*/ */
mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); mutex_lock(&dqopt->dqonoff_mutex);
for (cnt = 0; cnt < MAXQUOTAS; cnt++) { for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
if (type != -1 && cnt != type) if (type != -1 && cnt != type)
continue; continue;
if (!sb_has_quota_active(sb, cnt)) if (!sb_has_quota_active(sb, cnt))
continue; continue;
mutex_lock_nested(&sb_dqopt(sb)->files[cnt]->i_mutex, mutex_lock_nested(&dqopt->files[cnt]->i_mutex,
I_MUTEX_QUOTA); I_MUTEX_QUOTA);
truncate_inode_pages(&sb_dqopt(sb)->files[cnt]->i_data, 0); truncate_inode_pages(&dqopt->files[cnt]->i_data, 0);
mutex_unlock(&sb_dqopt(sb)->files[cnt]->i_mutex); mutex_unlock(&dqopt->files[cnt]->i_mutex);
} }
mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); mutex_unlock(&dqopt->dqonoff_mutex);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment