|
@@ -154,12 +154,17 @@ STATIC void
|
|
xfs_qm_destroy(
|
|
xfs_qm_destroy(
|
|
struct xfs_qm *xqm)
|
|
struct xfs_qm *xqm)
|
|
{
|
|
{
|
|
- struct xfs_dquot *dqp, *n;
|
|
|
|
int hsize, i;
|
|
int hsize, i;
|
|
|
|
|
|
ASSERT(xqm != NULL);
|
|
ASSERT(xqm != NULL);
|
|
ASSERT(xqm->qm_nrefs == 0);
|
|
ASSERT(xqm->qm_nrefs == 0);
|
|
|
|
+
|
|
unregister_shrinker(&xfs_qm_shaker);
|
|
unregister_shrinker(&xfs_qm_shaker);
|
|
|
|
+
|
|
|
|
+ mutex_lock(&xqm->qm_dqfrlist_lock);
|
|
|
|
+ ASSERT(list_empty(&xqm->qm_dqfrlist));
|
|
|
|
+ mutex_unlock(&xqm->qm_dqfrlist_lock);
|
|
|
|
+
|
|
hsize = xqm->qm_dqhashmask + 1;
|
|
hsize = xqm->qm_dqhashmask + 1;
|
|
for (i = 0; i < hsize; i++) {
|
|
for (i = 0; i < hsize; i++) {
|
|
xfs_qm_list_destroy(&(xqm->qm_usr_dqhtable[i]));
|
|
xfs_qm_list_destroy(&(xqm->qm_usr_dqhtable[i]));
|
|
@@ -171,17 +176,6 @@ xfs_qm_destroy(
|
|
xqm->qm_grp_dqhtable = NULL;
|
|
xqm->qm_grp_dqhtable = NULL;
|
|
xqm->qm_dqhashmask = 0;
|
|
xqm->qm_dqhashmask = 0;
|
|
|
|
|
|
- /* frlist cleanup */
|
|
|
|
- mutex_lock(&xqm->qm_dqfrlist_lock);
|
|
|
|
- list_for_each_entry_safe(dqp, n, &xqm->qm_dqfrlist, q_freelist) {
|
|
|
|
- xfs_dqlock(dqp);
|
|
|
|
- list_del_init(&dqp->q_freelist);
|
|
|
|
- xfs_Gqm->qm_dqfrlist_cnt--;
|
|
|
|
- xfs_dqunlock(dqp);
|
|
|
|
- xfs_qm_dqdestroy(dqp);
|
|
|
|
- }
|
|
|
|
- mutex_unlock(&xqm->qm_dqfrlist_lock);
|
|
|
|
- mutex_destroy(&xqm->qm_dqfrlist_lock);
|
|
|
|
kmem_free(xqm);
|
|
kmem_free(xqm);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -232,33 +226,9 @@ STATIC void
|
|
xfs_qm_rele_quotafs_ref(
|
|
xfs_qm_rele_quotafs_ref(
|
|
struct xfs_mount *mp)
|
|
struct xfs_mount *mp)
|
|
{
|
|
{
|
|
- xfs_dquot_t *dqp, *n;
|
|
|
|
-
|
|
|
|
ASSERT(xfs_Gqm);
|
|
ASSERT(xfs_Gqm);
|
|
ASSERT(xfs_Gqm->qm_nrefs > 0);
|
|
ASSERT(xfs_Gqm->qm_nrefs > 0);
|
|
|
|
|
|
- /*
|
|
|
|
- * Go thru the freelist and destroy all inactive dquots.
|
|
|
|
- */
|
|
|
|
- mutex_lock(&xfs_Gqm->qm_dqfrlist_lock);
|
|
|
|
-
|
|
|
|
- list_for_each_entry_safe(dqp, n, &xfs_Gqm->qm_dqfrlist, q_freelist) {
|
|
|
|
- xfs_dqlock(dqp);
|
|
|
|
- if (dqp->dq_flags & XFS_DQ_INACTIVE) {
|
|
|
|
- ASSERT(dqp->q_mount == NULL);
|
|
|
|
- ASSERT(! XFS_DQ_IS_DIRTY(dqp));
|
|
|
|
- ASSERT(list_empty(&dqp->q_hashlist));
|
|
|
|
- ASSERT(list_empty(&dqp->q_mplist));
|
|
|
|
- list_del_init(&dqp->q_freelist);
|
|
|
|
- xfs_Gqm->qm_dqfrlist_cnt--;
|
|
|
|
- xfs_dqunlock(dqp);
|
|
|
|
- xfs_qm_dqdestroy(dqp);
|
|
|
|
- } else {
|
|
|
|
- xfs_dqunlock(dqp);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Destroy the entire XQM. If somebody mounts with quotaon, this'll
|
|
* Destroy the entire XQM. If somebody mounts with quotaon, this'll
|
|
* be restarted.
|
|
* be restarted.
|
|
@@ -1728,8 +1698,6 @@ again:
|
|
* both the dquot and the freelistlock.
|
|
* both the dquot and the freelistlock.
|
|
*/
|
|
*/
|
|
if (dqp->dq_flags & XFS_DQ_WANT) {
|
|
if (dqp->dq_flags & XFS_DQ_WANT) {
|
|
- ASSERT(! (dqp->dq_flags & XFS_DQ_INACTIVE));
|
|
|
|
-
|
|
|
|
trace_xfs_dqreclaim_want(dqp);
|
|
trace_xfs_dqreclaim_want(dqp);
|
|
XQM_STATS_INC(xqmstats.xs_qm_dqwants);
|
|
XQM_STATS_INC(xqmstats.xs_qm_dqwants);
|
|
restarts++;
|
|
restarts++;
|
|
@@ -1737,23 +1705,6 @@ again:
|
|
goto dqunlock;
|
|
goto dqunlock;
|
|
}
|
|
}
|
|
|
|
|
|
- /*
|
|
|
|
- * If the dquot is inactive, we are assured that it is
|
|
|
|
- * not on the mplist or the hashlist, and that makes our
|
|
|
|
- * life easier.
|
|
|
|
- */
|
|
|
|
- if (dqp->dq_flags & XFS_DQ_INACTIVE) {
|
|
|
|
- ASSERT(mp == NULL);
|
|
|
|
- ASSERT(! XFS_DQ_IS_DIRTY(dqp));
|
|
|
|
- ASSERT(list_empty(&dqp->q_hashlist));
|
|
|
|
- ASSERT(list_empty(&dqp->q_mplist));
|
|
|
|
- list_del_init(&dqp->q_freelist);
|
|
|
|
- xfs_Gqm->qm_dqfrlist_cnt--;
|
|
|
|
- dqpout = dqp;
|
|
|
|
- XQM_STATS_INC(xqmstats.xs_qm_dqinact_reclaims);
|
|
|
|
- goto dqunlock;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
ASSERT(dqp->q_hash);
|
|
ASSERT(dqp->q_hash);
|
|
ASSERT(!list_empty(&dqp->q_mplist));
|
|
ASSERT(!list_empty(&dqp->q_mplist));
|
|
|
|
|