summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2005-03-31 05:14:28 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2005-03-31 05:14:28 -0800
commit102bbba64bde80e5cf25119096dba81adcf53933 (patch)
tree4448ef9d6123ff85daa03efe26bfc19df6fb092b /include/net
parent841d26e7e026eb5197b8073a6bf3f530b9f7603b (diff)
parent15d26df09084ff3a891a696efd0d56b52d852e24 (diff)
Merge bk://kernel.bkbits.net/acme/net-2.6
into sunset.davemloft.net:/home/davem/src/BK/net-2.6
Diffstat (limited to 'include/net')
-rw-r--r--include/net/llc_conn.h2
-rw-r--r--include/net/sock.h33
2 files changed, 8 insertions, 27 deletions
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h
index 179e98e2aac8..8ad3bc2c23d7 100644
--- a/include/net/llc_conn.h
+++ b/include/net/llc_conn.h
@@ -92,7 +92,7 @@ static __inline__ char llc_backlog_type(struct sk_buff *skb)
return skb->cb[sizeof(skb->cb) - 1];
}
-extern struct sock *llc_sk_alloc(int family, int priority);
+extern struct sock *llc_sk_alloc(int family, int priority, struct proto *prot);
extern void llc_sk_free(struct sock *sk);
extern void llc_sk_reset(struct sock *sk);
diff --git a/include/net/sock.h b/include/net/sock.h
index fb789af4ab08..be81cabd0da3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -154,12 +154,10 @@ struct sock_common {
* @sk_sndtimeo - %SO_SNDTIMEO setting
* @sk_filter - socket filtering instructions
* @sk_protinfo - private area, net family specific, when not using slab
- * @sk_slab - the slabcache this instance was allocated from
* @sk_timer - sock cleanup timer
* @sk_stamp - time stamp of last packet received
* @sk_socket - Identd and reporting IO signals
* @sk_user_data - RPC layer private data
- * @sk_owner - module that owns this socket
* @sk_sndmsg_page - cached page for sendmsg
* @sk_sndmsg_off - cached offset for sendmsg
* @sk_send_head - front of stuff to transmit
@@ -231,12 +229,10 @@ struct sock {
long sk_sndtimeo;
struct sk_filter *sk_filter;
void *sk_protinfo;
- kmem_cache_t *sk_slab;
struct timer_list sk_timer;
struct timeval sk_stamp;
struct socket *sk_socket;
void *sk_user_data;
- struct module *sk_owner;
struct page *sk_sndmsg_page;
struct sk_buff *sk_send_head;
__u32 sk_sndmsg_off;
@@ -546,37 +542,22 @@ struct proto {
int max_header;
kmem_cache_t *slab;
- int slab_obj_size;
+ unsigned int obj_size;
struct module *owner;
char name[32];
+ struct list_head node;
+
struct {
int inuse;
u8 __pad[SMP_CACHE_BYTES - sizeof(int)];
} stats[NR_CPUS];
};
-extern int sk_alloc_slab(struct proto *prot, char *name);
-extern void sk_free_slab(struct proto *prot);
-
-static __inline__ void sk_set_owner(struct sock *sk, struct module *owner)
-{
- /*
- * One should use sk_set_owner just once, after struct sock creation,
- * be it shortly after sk_alloc or after a function that returns a new
- * struct sock (and that down the call chain called sk_alloc), e.g. the
- * IPv4 and IPv6 modules share tcp_create_openreq_child, so if
- * tcp_create_openreq_child called sk_set_owner IPv6 would have to
- * change the ownership of this struct sock, with one not needed
- * transient sk_set_owner call.
- */
- BUG_ON(sk->sk_owner != NULL);
-
- sk->sk_owner = owner;
- __module_get(owner);
-}
+extern int proto_register(struct proto *prot, int alloc_slab);
+extern void proto_unregister(struct proto *prot);
/* Called with local bh disabled */
static __inline__ void sock_prot_inc_use(struct proto *prot)
@@ -696,8 +677,8 @@ extern void FASTCALL(release_sock(struct sock *sk));
#define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock))
#define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock))
-extern struct sock * sk_alloc(int family, int priority, int zero_it,
- kmem_cache_t *slab);
+extern struct sock *sk_alloc(int family, int priority,
+ struct proto *prot, int zero_it);
extern void sk_free(struct sock *sk);
extern struct sk_buff *sock_wmalloc(struct sock *sk,