Subject: Re: [PATCH v3] net: #ifdef inet_bind_bucket::ib_net

From: Eric Dumazet <[email-masked]>
Date: Fri, 14 Nov 2008 05:36:15 +0100

Alexey Dobriyan a écrit :
>>> Something is wrong with read_pnet() as nobody suggested to mass use it
>>> or send a patch doing it.
>> I did. My plan is to zap all superflous #ifdef CONFIG_NET_NS if possible.
> 
> That's not mass usage.
> 
> Mass usage is, say, s/dev_net/read_pnet/.
> 
> Do you want to do this too?

Yes, it was present on my original first patch.
I said I was going to split the big patch.
How many mails will be necessary until you get the point ?

I was waiting *you* change "read_pnet()/write_pnet()" names as you
intended, *before* submitting new patches, in order not to
duplicate work.

For instance, I dont like :

static inline
struct net *dev_net(const struct net_device *dev)
{
#ifdef CONFIG_NET_NS
        return dev->nd_net;
#else
        return &init_net;
#endif
}

I prefer :

static inline
struct net *dev_net(const struct net_device *dev)
{
	return read_pnet(&dev->nd_net);
}

This is better because :

1) No #ifdef CONFIG_NET_NS

2) The magic about &init_net is not duplicated in ten different include files, but
   centralized in the right file : include/net/net_namespace.h