aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dquot.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dquot.c')
-rw-r--r--fs/xfs/xfs_dquot.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 2a9ffc1086bc..3f94f2428a35 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -1302,6 +1302,14 @@ xfs_qm_dqpurge(
1302 ASSERT(mutex_is_locked(&mp->m_quotainfo->qi_dqlist_lock)); 1302 ASSERT(mutex_is_locked(&mp->m_quotainfo->qi_dqlist_lock));
1303 ASSERT(mutex_is_locked(&dqp->q_hash->qh_lock)); 1303 ASSERT(mutex_is_locked(&dqp->q_hash->qh_lock));
1304 1304
1305 /*
1306 * XXX(hch): horrible locking order, will get cleaned up ASAP.
1307 */
1308 if (!mutex_trylock(&xfs_Gqm->qm_dqfrlist_lock)) {
1309 mutex_unlock(&dqp->q_hash->qh_lock);
1310 return 1;
1311 }
1312
1305 xfs_dqlock(dqp); 1313 xfs_dqlock(dqp);
1306 /* 1314 /*
1307 * We really can't afford to purge a dquot that is 1315 * We really can't afford to purge a dquot that is
@@ -1364,25 +1372,23 @@ xfs_qm_dqpurge(
1364 1372
1365 list_del_init(&dqp->q_hashlist); 1373 list_del_init(&dqp->q_hashlist);
1366 qh->qh_version++; 1374 qh->qh_version++;
1375
1367 list_del_init(&dqp->q_mplist); 1376 list_del_init(&dqp->q_mplist);
1368 mp->m_quotainfo->qi_dqreclaims++; 1377 mp->m_quotainfo->qi_dqreclaims++;
1369 mp->m_quotainfo->qi_dquots--; 1378 mp->m_quotainfo->qi_dquots--;
1370 /*
1371 * XXX Move this to the front of the freelist, if we can get the
1372 * freelist lock.
1373 */
1374 ASSERT(!list_empty(&dqp->q_freelist));
1375 1379
1376 dqp->q_mount = NULL; 1380 list_del_init(&dqp->q_freelist);
1377 dqp->q_hash = NULL; 1381 xfs_Gqm->qm_dqfrlist_cnt--;
1378 dqp->dq_flags = XFS_DQ_INACTIVE; 1382
1379 memset(&dqp->q_core, 0, sizeof(dqp->q_core));
1380 xfs_dqfunlock(dqp); 1383 xfs_dqfunlock(dqp);
1381 xfs_dqunlock(dqp); 1384 xfs_dqunlock(dqp);
1385
1386 mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
1382 mutex_unlock(&qh->qh_lock); 1387 mutex_unlock(&qh->qh_lock);
1383 return (0);
1384}
1385 1388
1389 xfs_qm_dqdestroy(dqp);
1390 return 0;
1391}
1386 1392
1387/* 1393/*
1388 * Give the buffer a little push if it is incore and 1394 * Give the buffer a little push if it is incore and