summaryrefslogtreecommitdiffstats
path: root/fs/quota/quota_v2.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-06-08 17:20:36 +0200
committerJan Kara <jack@suse.cz>2017-08-17 19:04:01 +0200
commitb9a1a7f4b6b5861c6ae89a125271103ceb8c8690 (patch)
tree707cfa635f1b5ddd747982433a3538bacd476dae /fs/quota/quota_v2.c
parentf0c5bae5cc562307f804335ddec3f793254c3766 (diff)
downloadlinux-b9a1a7f4b6b5861c6ae89a125271103ceb8c8690.tar.bz2
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.c9
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)