diff options
author | Jan Kara <jack@suse.cz> | 2017-06-08 18:20:36 +0300 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2017-08-17 20:04:01 +0300 |
commit | b9a1a7f4b6b5861c6ae89a125271103ceb8c8690 (patch) | |
tree | 707cfa635f1b5ddd747982433a3538bacd476dae /fs/quota/dquot.c | |
parent | f0c5bae5cc562307f804335ddec3f793254c3766 (diff) | |
download | linux-b9a1a7f4b6b5861c6ae89a125271103ceb8c8690.tar.xz |
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>
Diffstat (limited to 'fs/quota/dquot.c')
-rw-r--r-- | fs/quota/dquot.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 562f5978488f..3b3c7f094ff8 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -478,19 +478,19 @@ int dquot_release(struct dquot *dquot) /* Check whether we are not racing with some other dqget() */ if (atomic_read(&dquot->dq_count) > 1) goto out_dqlock; - down_write(&dqopt->dqio_sem); if (dqopt->ops[dquot->dq_id.type]->release_dqblk) { ret = dqopt->ops[dquot->dq_id.type]->release_dqblk(dquot); /* Write the info */ if (info_dirty(&dqopt->info[dquot->dq_id.type])) { + down_write(&dqopt->dqio_sem); ret2 = dqopt->ops[dquot->dq_id.type]->write_file_info( dquot->dq_sb, dquot->dq_id.type); + up_write(&dqopt->dqio_sem); } if (ret >= 0) ret = ret2; } clear_bit(DQ_ACTIVE_B, &dquot->dq_flags); - up_write(&dqopt->dqio_sem); out_dqlock: mutex_unlock(&dquot->dq_lock); return ret; |