From 6e6a85677c54a7d4c342b95704311ac45ffe719f Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 6 Dec 2011 21:58:15 +0000 Subject: [PATCH] --- yaml --- r: 280313 b: refs/heads/master c: 497507b9ee63499d364ad7149c584285cd925dfc h: refs/heads/master i: 280311: d219eb0a40a9db31fd0b7fc1dc06ded41760f5bb v: v3 --- [refs] | 2 +- trunk/fs/xfs/xfs_dquot.c | 25 +++++-------------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index 8ea7ba4f199f..3560446c083d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 800b484ec0262946262ad20561a8081fd31f4a6f +refs/heads/master: 497507b9ee63499d364ad7149c584285cd925dfc diff --git a/trunk/fs/xfs/xfs_dquot.c b/trunk/fs/xfs/xfs_dquot.c index 13eef1f92d20..2a9ffc1086bc 100644 --- a/trunk/fs/xfs/xfs_dquot.c +++ b/trunk/fs/xfs/xfs_dquot.c @@ -710,12 +710,9 @@ xfs_qm_dqlookup( xfs_dquot_t **O_dqpp) { xfs_dquot_t *dqp; - uint flist_locked; ASSERT(mutex_is_locked(&qh->qh_lock)); - flist_locked = B_FALSE; - /* * Traverse the hashchain looking for a match */ @@ -750,31 +747,19 @@ xfs_qm_dqlookup( xfs_dqlock(dqp); dqp->dq_flags &= ~(XFS_DQ_WANT); } - flist_locked = B_TRUE; - } - - /* - * id couldn't have changed; we had the hashlock all - * along - */ - ASSERT(be32_to_cpu(dqp->q_core.d_id) == id); - if (flist_locked) { - if (dqp->q_nrefs != 0) { - mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock); - flist_locked = B_FALSE; - } else { + if (dqp->q_nrefs == 0) { /* take it off the freelist */ trace_xfs_dqlookup_freelist(dqp); list_del_init(&dqp->q_freelist); xfs_Gqm->qm_dqfrlist_cnt--; } + XFS_DQHOLD(dqp); + mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock); + } else { + XFS_DQHOLD(dqp); } - XFS_DQHOLD(dqp); - - if (flist_locked) - mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock); /* * move the dquot to the front of the hashchain */