]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/net/netns/generic.h
netns: let net_generic take pointer-to-const args
[net-next-2.6.git] / include / net / netns / generic.h
index ff4982ab84b60ecfbcc764d460a15f7bbb87a4da..3419bf5cd15401d611373f961edb7dcb344315d1 100644 (file)
  * 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.
  *
@@ -33,7 +30,7 @@ struct net_generic {
        void *ptr[0];
 };
 
-static inline void *net_generic(struct net *net, int id)
+static inline void *net_generic(const struct net *net, int id)
 {
        struct net_generic *ng;
        void *ptr;
@@ -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