diff options
author | Jan Kara <jack@suse.cz> | 2017-06-08 17:20:36 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2017-08-17 19:04:01 +0200 |
commit | b9a1a7f4b6b5861c6ae89a125271103ceb8c8690 (patch) | |
tree | 707cfa635f1b5ddd747982433a3538bacd476dae /fs/quota/quota_v2.c | |
parent | quota: Remove locking for writing to the old quota format (diff) | |
download | linux-b9a1a7f4b6b5861c6ae89a125271103ceb8c8690.tar.xz linux-b9a1a7f4b6b5861c6ae89a125271103ceb8c8690.zip |
quota: Push dqio_sem down to ->release_dqblk()
Push down acquisition of dqio_sem into ->release_dqblk() callback. It
will allow quota formats to decide whether they need it or not.
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 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index 7a05b80f3b8c..8f54b159e423 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -322,7 +322,14 @@ static int v2_write_dquot(struct dquot *dquot) static int v2_release_dquot(struct dquot *dquot) { - return qtree_release_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot); + struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); + int ret; + + down_write(&dqopt->dqio_sem); + ret = qtree_release_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot); + up_write(&dqopt->dqio_sem); + + return ret; } static int v2_free_file_info(struct super_block *sb, int type) |