Commit f14618c6 authored by Jan Kara's avatar Jan Kara

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: default avatarAndreas Dilger <adilger@dilger.ca>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent b9a1a7f4
...@@ -2067,16 +2067,12 @@ EXPORT_SYMBOL(dquot_commit_info); ...@@ -2067,16 +2067,12 @@ EXPORT_SYMBOL(dquot_commit_info);
int dquot_get_next_id(struct super_block *sb, struct kqid *qid) int dquot_get_next_id(struct super_block *sb, struct kqid *qid)
{ {
struct quota_info *dqopt = sb_dqopt(sb); struct quota_info *dqopt = sb_dqopt(sb);
int err;
if (!sb_has_quota_active(sb, qid->type)) if (!sb_has_quota_active(sb, qid->type))
return -ESRCH; return -ESRCH;
if (!dqopt->ops[qid->type]->get_next_id) if (!dqopt->ops[qid->type]->get_next_id)
return -ENOSYS; return -ENOSYS;
down_read(&dqopt->dqio_sem); return dqopt->ops[qid->type]->get_next_id(sb, qid);
err = dqopt->ops[qid->type]->get_next_id(sb, qid);
up_read(&dqopt->dqio_sem);
return err;
} }
EXPORT_SYMBOL(dquot_get_next_id); EXPORT_SYMBOL(dquot_get_next_id);
......
...@@ -340,7 +340,13 @@ static int v2_free_file_info(struct super_block *sb, int type) ...@@ -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) 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 = { static const struct quota_format_ops v2_format_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment