Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2007 18:48:55 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Marko Zec <zec@FreeBSD.org>
Cc:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   Re: PERFORCE change 127639 for review
Message-ID:  <4716BB87.1040004@elischer.org>
In-Reply-To: <200710172258.l9HMw33S061205@repoman.freebsd.org>
References:  <200710172258.l9HMw33S061205@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Marko Zec wrote:
> http://perforce.freebsd.org/chv.cgi?CH=127639
> 
> Change 127639 by zec@zec_tpx32 on 2007/10/17 22:57:48
> 
> 	Introduce a few macros for easier and more readable fetching
> 	of virtualized resource context from a ptr to a proc or thread.
> 	
> 	The additional benefit is that if we ever decide not to hang
> 	vimage / vnet etc. from struct ucred but use some other
> 	method instead, we won't have to change hundreds of lines of
> 	code, but only those few new macros...
I see this sort of thing many times..



> +        INIT_VPROCG(TD_TO_VPROCG(curthread));
>
> +	INIT_VPROCG(TD_TO_VPROCG(curthread));
>
> +	INIT_VNET_NET(TD_TO_VNET(curthread));

> +	INIT_VNET_NET(TD_TO_VNET(curthread));
>
> +	INIT_VNET_NET(TD_TO_VNET(td));

> +	INIT_VPROCG(TD_TO_VPROCG(td));

> +	INIT_VPROCG(TD_TO_VPROCG(td));

> +	INIT_VPROCG(TD_TO_VPROCG(curthread)); /* XXX */

> +	INIT_VPROCG(TD_TO_VPROCG(curthread));

> +	INIT_VPROCG(TD_TO_VPROCG(curthread));

> +	INIT_VPROCG(TD_TO_VPROCG(curthread)); /* XXX */
>  

> +	INIT_VPROCG(TD_TO_VPROCG(curthread));

> +	INIT_VPROCG(TD_TO_VPROCG(curthread));
>  

might not they be further macroised as:

#define VNET_FROM_TD(_td)   INIT_VNET_NET(TD_TO_VNET(_td))
#define VPROCG_FROM_TD(_td) INIT_VPROCG(TD_TO_VPROCG(_td))

etc.

not a requirement.. just a comment.





> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4716BB87.1040004>