summaryrefslogtreecommitdiffstats
path: root/fs/quota/quota_v2.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-06-08 15:48:16 +0200
committerJan Kara <jack@suse.cz>2017-08-17 19:03:09 +0200
commit8fc32c2b0db2c9ee0dffebea65bcdea03a29ba5a (patch)
tree1ad92b623f562ac9f160fb4ea8e4c9073d2cb4f5 /fs/quota/quota_v2.c
parent47cdc11deed639ae1d4050efbc284d328c3c2fa5 (diff)
downloadlinux-8fc32c2b0db2c9ee0dffebea65bcdea03a29ba5a.tar.bz2
quota: Push dqio_sem down to ->write_dqblk()
Push down acquisition of dqio_sem into ->write_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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index b2cd34f6b3da..482733abe4ac 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -298,7 +298,15 @@ static int v2_read_dquot(struct dquot *dquot)
static int v2_write_dquot(struct dquot *dquot)
{
- return qtree_write_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_write_dquot(
+ sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv,
+ dquot);
+ up_write(&dqopt->dqio_sem);
+ return ret;
}
static int v2_release_dquot(struct dquot *dquot)