mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 00:20:32 +00:00
quota: Push dqio_sem down to ->release_dqblk()
Push down acquisition of dqio_sem into ->release_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>
This commit is contained in:
parent
f0c5bae5cc
commit
b9a1a7f4b6
2 changed files with 10 additions and 3 deletions
|
@ -478,19 +478,19 @@ int dquot_release(struct dquot *dquot)
|
||||||
/* Check whether we are not racing with some other dqget() */
|
/* Check whether we are not racing with some other dqget() */
|
||||||
if (atomic_read(&dquot->dq_count) > 1)
|
if (atomic_read(&dquot->dq_count) > 1)
|
||||||
goto out_dqlock;
|
goto out_dqlock;
|
||||||
down_write(&dqopt->dqio_sem);
|
|
||||||
if (dqopt->ops[dquot->dq_id.type]->release_dqblk) {
|
if (dqopt->ops[dquot->dq_id.type]->release_dqblk) {
|
||||||
ret = dqopt->ops[dquot->dq_id.type]->release_dqblk(dquot);
|
ret = dqopt->ops[dquot->dq_id.type]->release_dqblk(dquot);
|
||||||
/* Write the info */
|
/* Write the info */
|
||||||
if (info_dirty(&dqopt->info[dquot->dq_id.type])) {
|
if (info_dirty(&dqopt->info[dquot->dq_id.type])) {
|
||||||
|
down_write(&dqopt->dqio_sem);
|
||||||
ret2 = dqopt->ops[dquot->dq_id.type]->write_file_info(
|
ret2 = dqopt->ops[dquot->dq_id.type]->write_file_info(
|
||||||
dquot->dq_sb, dquot->dq_id.type);
|
dquot->dq_sb, dquot->dq_id.type);
|
||||||
|
up_write(&dqopt->dqio_sem);
|
||||||
}
|
}
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
ret = ret2;
|
ret = ret2;
|
||||||
}
|
}
|
||||||
clear_bit(DQ_ACTIVE_B, &dquot->dq_flags);
|
clear_bit(DQ_ACTIVE_B, &dquot->dq_flags);
|
||||||
up_write(&dqopt->dqio_sem);
|
|
||||||
out_dqlock:
|
out_dqlock:
|
||||||
mutex_unlock(&dquot->dq_lock);
|
mutex_unlock(&dquot->dq_lock);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -322,7 +322,14 @@ static int v2_write_dquot(struct dquot *dquot)
|
||||||
|
|
||||||
static int v2_release_dquot(struct dquot *dquot)
|
static int v2_release_dquot(struct dquot *dquot)
|
||||||
{
|
{
|
||||||
return qtree_release_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_release_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot);
|
||||||
|
up_write(&dqopt->dqio_sem);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int v2_free_file_info(struct super_block *sb, int type)
|
static int v2_free_file_info(struct super_block *sb, int type)
|
||||||
|
|
Loading…
Reference in a new issue