From f14618c6823ee0f9f92a87aad7d5ad26916ccff1 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Fri, 9 Jun 2017 08:36:16 +0200 Subject: quota: Push dqio_sem down to ->get_next_id() Push down acquisition of dqio_sem into ->get_next_id() callback. Mostly for consistency with other operations. Reviewed-by: Andreas Dilger Signed-off-by: Jan Kara --- fs/quota/quota_v2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'fs/quota/quota_v2.c') diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index 8f54b159e423..f82638e43c07 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -340,7 +340,13 @@ static int v2_free_file_info(struct super_block *sb, int type) static int v2_get_next_id(struct super_block *sb, struct kqid *qid) { - return qtree_get_next_id(sb_dqinfo(sb, qid->type)->dqi_priv, qid); + struct quota_info *dqopt = sb_dqopt(sb); + int ret; + + down_read(&dqopt->dqio_sem); + ret = qtree_get_next_id(sb_dqinfo(sb, qid->type)->dqi_priv, qid); + up_read(&dqopt->dqio_sem); + return ret; } static const struct quota_format_ops v2_format_ops = { -- cgit v1.2.3