[Devel] Re: [PATCH 03/53] netns xfrm: add struct xfrm_state::xs_net
Alexey Dobriyan
adobriyan at gmail.com
Tue Nov 25 20:25:02 PST 2008
On Tue, Nov 25, 2008 at 05:15:36PM -0800, David Miller wrote:
> From: Alexey Dobriyan <adobriyan at gmail.com>
> Date: Tue, 25 Nov 2008 20:26:35 +0300
>
> > To avoid unnecessary complications with passing netns around.
> >
> > * set once, very early after allocating
> > * once set, never changes
> >
> > For a while create every xfrm_state in init_net.
> >
> > Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
>
> Applied.
>
> > @@ -223,6 +226,11 @@ struct xfrm_state
> > void *data;
> > };
> >
> > +static inline struct net *xs_net(struct xfrm_state *x)
> > +{
> > + return read_pnet(&x->xs_net);
> > +}
> > +
> > /* xflags - make enum if more show up */
>
> Look mom, no ifdefs! Amazing!
There're gone and won't return, honey.
In fact, I don't like pnet only a little now and thinking about:
net = read_net(foo->foo_net);
write_net(foo->foo_net, net);
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list