diff options
author | Jan Kara <jack@suse.cz> | 2017-06-09 08:45:43 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2017-08-17 19:11:23 +0200 |
commit | 9a8ae30e73cb8827dd0a8ae5fd505db457cfb7ed (patch) | |
tree | ebc569647ebbffa64b3cbfe81873a97aacb0c3f7 /fs/quota/quota_v2.c | |
parent | f14618c6823ee0f9f92a87aad7d5ad26916ccff1 (diff) |
quota: Push dqio_sem down to ->write_file_info()
Push down acquisition of dqio_sem into ->write_file_info() callback.
Mostly for consistency with other operations.
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota/quota_v2.c')
-rw-r--r-- | fs/quota/quota_v2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index f82638e43c07..5e47012d2f57 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -154,10 +154,12 @@ static int v2_read_file_info(struct super_block *sb, int type) static int v2_write_file_info(struct super_block *sb, int type) { struct v2_disk_dqinfo dinfo; - struct mem_dqinfo *info = sb_dqinfo(sb, type); + struct quota_info *dqopt = sb_dqopt(sb); + struct mem_dqinfo *info = &dqopt->info[type]; struct qtree_mem_dqinfo *qinfo = info->dqi_priv; ssize_t size; + down_write(&dqopt->dqio_sem); spin_lock(&dq_data_lock); info->dqi_flags &= ~DQF_INFO_DIRTY; dinfo.dqi_bgrace = cpu_to_le32(info->dqi_bgrace); @@ -170,6 +172,7 @@ static int v2_write_file_info(struct super_block *sb, int type) dinfo.dqi_free_entry = cpu_to_le32(qinfo->dqi_free_entry); size = sb->s_op->quota_write(sb, type, (char *)&dinfo, sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); + up_write(&dqopt->dqio_sem); if (size != sizeof(struct v2_disk_dqinfo)) { quota_error(sb, "Can't write info structure"); return -1; |