aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/quota/quota_v2.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-06-09 08:36:16 +0200
committerJan Kara <jack@suse.cz>2017-08-17 19:05:16 +0200
commitf14618c6823ee0f9f92a87aad7d5ad26916ccff1 (patch)
tree6cb1b9a685046e6bd0197952f8078d31c7b5f772 /fs/quota/quota_v2.c
parentquota: Push dqio_sem down to ->release_dqblk() (diff)
downloadwireguard-linux-f14618c6823ee0f9f92a87aad7d5ad26916ccff1.tar.xz
wireguard-linux-f14618c6823ee0f9f92a87aad7d5ad26916ccff1.zip
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 <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.c8
1 files changed, 7 insertions, 1 deletions
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 = {