xfs
[Top] [All Lists]

Re: [PATCH 07/16] xfs: remove XFS_DQ_INACTIVE

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 07/16] xfs: remove XFS_DQ_INACTIVE
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 5 Dec 2011 15:23:51 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20111128082837.441012540@xxxxxxxxxxxxxxxxxxxxxx>
References: <20111128082722.604873274@xxxxxxxxxxxxxxxxxxxxxx> <20111128082837.441012540@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Nov 28, 2011 at 03:27:29AM -0500, Christoph Hellwig wrote:
> Free dquots when purging them during umount instead of keeping them around
> on the freelist in a degraded state.  The out of order locking in
> xfs_qm_dqpurge will be removed again later in this series.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

>  
> -     dqp->q_mount = NULL;
> -     dqp->q_hash = NULL;
> -     dqp->dq_flags = XFS_DQ_INACTIVE;
> -     memset(&dqp->q_core, 0, sizeof(dqp->q_core));
> +     list_del_init(&dqp->q_freelist);
> +     xfs_Gqm->qm_dqfrlist_cnt--;
> +
>       xfs_dqfunlock(dqp);
>       xfs_dqunlock(dqp);
> +
> +     mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
>       mutex_unlock(&qh->qh_lock);
> +
> +     xfs_qm_dqdestroy(dqp);
>       return (0);
>  }

While there, you may as well make that a "return 0;"

> @@ -171,17 +176,6 @@ xfs_qm_destroy(
>       xqm->qm_grp_dqhtable = NULL;
>       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);
>  }

Don't we still need that mutex_destroy() call there?

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>