X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fnet%2Fsock.h;h=ff333ca9cd38643691b8f0522637dff683aac4df;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=fb4df58ec4a36ad4e47e75e46bf925c5ceb4f555;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/include/net/sock.h b/include/net/sock.h index fb4df58ec..ff333ca9c 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -146,7 +146,6 @@ struct sock_common { * @sk_route_caps - route capabilities (e.g. %NETIF_F_TSO) * @sk_lingertime - %SO_LINGER l_linger setting * @sk_hashent - hash entry in several tables (e.g. tcp_ehash) - * @sk_pair - socket pair (e.g. AF_UNIX/unix_peer) * @sk_backlog - always used with the per-socket spinlock held * @sk_callback_lock - used with the callbacks in the end of this struct * @sk_error_queue - rarely used @@ -227,7 +226,6 @@ struct sock { int sk_route_caps; unsigned long sk_lingertime; int sk_hashent; - struct sock *sk_pair; /* * The backlog queue is special, it is always used with * the per-socket spinlock held and requires low latency @@ -563,6 +561,11 @@ struct proto { int *sysctl_rmem; int max_header; + kmem_cache_t *slab; + int slab_obj_size; + + struct module *owner; + char name[32]; struct { @@ -571,6 +574,14 @@ struct proto { } 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_alloc_slab_error(struct proto *proto) +{ + printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", proto->name); +} + static __inline__ void sk_set_owner(struct sock *sk, struct module *owner) { /* @@ -697,8 +708,6 @@ static inline int sk_stream_rmem_schedule(struct sock *sk, struct sk_buff *skb) * Since ~2.3.5 it is also exclusive sleep lock serializing * accesses from user process context. */ -extern void __lock_sock(struct sock *sk); -extern void __release_sock(struct sock *sk); #define sock_owned_by_user(sk) ((sk)->sk_lock.owner) extern void FASTCALL(lock_sock(struct sock *sk)); @@ -732,11 +741,6 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, int noblock, int *errcode); -extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk, - unsigned long header_len, - unsigned long data_len, - int noblock, - int *errcode); extern void *sock_kmalloc(struct sock *sk, int size, int priority); extern void sock_kfree_s(struct sock *sk, void *mem, int size); extern void sk_send_sigurg(struct sock *sk); @@ -745,7 +749,6 @@ extern void sk_send_sigurg(struct sock *sk); * Functions to fill in entries in struct proto_ops when a protocol * does not implement a particular function. */ -extern int sock_no_release(struct socket *); extern int sock_no_bind(struct socket *, struct sockaddr *, int); extern int sock_no_connect(struct socket *, @@ -795,8 +798,6 @@ extern void sk_common_release(struct sock *sk); * Default socket callbacks and setup code */ -extern void sock_def_destruct(struct sock *); - /* Initialise core socket variables */ extern void sock_init_data(struct socket *sock, struct sock *sk); @@ -1272,20 +1273,7 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) __kfree_skb(skb); } -extern atomic_t netstamp_needed; extern void sock_enable_timestamp(struct sock *sk); -extern void sock_disable_timestamp(struct sock *sk); - -static inline void net_timestamp(struct timeval *stamp) -{ - if (atomic_read(&netstamp_needed)) - do_gettimeofday(stamp); - else { - stamp->tv_sec = 0; - stamp->tv_usec = 0; - } -} - extern int sock_get_timestamp(struct sock *, struct timeval __user *); /* @@ -1335,6 +1323,13 @@ static inline void sock_valbool_flag(struct sock *sk, int bit, int valbool) extern __u32 sysctl_wmem_max; extern __u32 sysctl_rmem_max; +#ifdef CONFIG_NET int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); +#else +static inline int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + return -ENODEV; +} +#endif #endif /* _SOCK_H */