summaryrefslogtreecommitdiff
path: root/fs/quota/quota_v2.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-06-08 16:30:45 +0300
committerJan Kara <jack@suse.cz>2017-08-17 20:01:00 +0300
commite342e38df925973b86cd46d40bbe7f083414e2ad (patch)
treeace185b868c9439b20fc9febf997e29770d4dc37 /fs/quota/quota_v2.c
parent5e8cb9b6249de3ac036ef4cf4b7babc2f4b95d90 (diff)
downloadlinux-e342e38df925973b86cd46d40bbe7f083414e2ad.tar.xz
quota: Push dqio_sem down to ->read_dqblk()
Push down acquisition of dqio_sem into ->read_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 ca71bf881ad1..b2cd34f6b3da 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -285,7 +285,15 @@ static int v2r1_is_id(void *dp, struct dquot *dquot)
static int v2_read_dquot(struct dquot *dquot)
{
- return qtree_read_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_read(&dqopt->dqio_sem);
+ ret = qtree_read_dquot(
+ sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv,
+ dquot);
+ up_read(&dqopt->dqio_sem);
+ return ret;
}
static int v2_write_dquot(struct dquot *dquot)