[PATCH 3/5] xfs: use per-filesystem radix trees for dquot lookup

Ben Myers bpm at sgi.com
Tue Mar 13 12:06:02 CDT 2012


On Tue, Mar 13, 2012 at 04:52:35AM -0400, Christoph Hellwig wrote:
> Replace the global hash tables for looking up in-memory dquot structures
> with per-filesystem radix trees to allow scaling to a large number of
> in-memory dquot structures.
> 
> Reviewed-by: Dave Chinner <dchinner at redhat.com>
> Signed-off-by: Christoph Hellwig <hch at lst.de>

...

> @@ -780,51 +712,27 @@ restart:
>  		}
>  	}
>  
> -	/*
> -	 * Hashlock comes after ilock in lock order
> -	 */
> -	mutex_lock(&h->qh_lock);
> -	if (version != h->qh_version) {
> -		xfs_dquot_t *tmpdqp;
> +	mutex_lock(&qi->qi_tree_lock);
> +	error = -radix_tree_insert(tree, id, dqp);
> +	if (unlikely(error)) {
> +		WARN_ON(error != EEXIST);

Yeah, radix_tree_insert can return ENOMEM.

Looks good.

Reviewed-by: Ben Myers <bpm at sgi.com>



More information about the xfs mailing list