PERFORCE change 127639 for review

Julian Elischer julian at elischer.org
Wed Oct 17 18:48:40 PDT 2007


Marko Zec wrote:
> http://perforce.freebsd.org/chv.cgi?CH=127639
> 
> Change 127639 by zec at 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.





> 


More information about the p4-projects mailing list