net: disallow to use net_assign_generic externally

Now there's no need to use this fuction directly because it's handled by
register_pernet_device. So to make this simple and easy to understand,
make this static to do not tempt potentional users.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko
2010-04-23 01:40:47 +00:00
committed by David S. Miller
parent 47d54d6582
commit 05fceb4ad7
2 changed files with 47 additions and 53 deletions

View File

@ -14,11 +14,8 @@
* The rules are simple:
* 1. set pernet_operations->id. After register_pernet_device you
* will have the id of your private pointer.
* 2. Either set pernet_operations->size (to have the code allocate and
* free a private structure pointed to from struct net ) or
* call net_assign_generic() to put the private data on the struct
* net (most preferably this should be done in the ->init callback
* of the ops registered);
* 2. set pernet_operations->size to have the code allocate and free
* a private structure pointed to from struct net.
* 3. do not change this pointer while the net is alive;
* 4. do not try to have any private reference on the net_generic object.
*
@ -46,6 +43,4 @@ static inline void *net_generic(struct net *net, int id)
return ptr;
}
extern int net_assign_generic(struct net *net, int id, void *data);
#endif