zerocopy NFS, ipv4 infrastructure
Subsystems (9)
PATCH 1/1 zerocopy NFS, ipv4 infrastructure
Neil, other NFS developers. I am about to push the following set of patches to Linus for 2.5.x
It implements several things, most important to NFS folks are the UDP cork/sendfile bits done by VA Linux Japan.
The rest is just initial infrastructure for encapsulating protocols (ie. ipsec and ipcomp).
I'm sending this so that you can start integrating the rest of the NFS zerocopy patches done by VA Linux Japan before this shows up for real in Linus's tree.
Have fun.
[email protected], 2002-10-14 13:41:39-07:00, [email protected]
[NET]: Kill final traces of csum_partial_copy_fromuser.
include/asm-alpha/checksum.h +2 -8
@@ -42,16 +42,10 @@* * here even more important to align src and dst on a 32-bit (or even * better 64-bit) boundary -*/ -unsigned int csum_partial_copy (const char *src,char *dst,int len,unsigned int sum); - -/* -* the same as csum_partial, but copies from user space (but on the alpha -* we have just one address space, so this is identical to the above) * -* this is obsolete and will go away. +* this will go away soon. */ -#define csum_partial_copy_fromuser csum_partial_copy +unsigned int csum_partial_copy (const char *src,char *dst,int len,unsigned int sum);/* * this is a new version of the above that records errors it finds in *errp,
include/asm-arm/checksum.h +3 -3
@@ -38,10 +38,10 @@ csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr);/* -* These are the old (and unsafe) way of doing checksums, a warning message will be -* printed if they are used and an exception occurs. +* This is the old (and unsafe) way of doing checksums, a warning message will +* be printed if it is used and an exception occurs. * -* these functions should go away after some time. +* this functions should go away after some time. */ #define csum_partial_copy (src,dst,len,sum) csum_partial_copy_nocheck(src,dst,len,sum)
include/asm-i386/checksum.h +3 -5
@@ -50,13 +50,11 @@ }/* -* These are the old (and unsafe) way of doing checksums, a warning message will be -* printed if they are used and an exeption occurs. +* This is the old (and unsafe) way of doing checksums, a warning message will +* be printed if it is used and an exeption occurs. * -* these functions should go away after some time. +* this function should go away after some time. */ - -#define csum_partial_copy_fromuser csum_partial_copyunsigned int csum_partial_copy (const char *src,char *dst,int len,int sum);/*
include/asm-ia64/checksum.h +2 -9
@@ -48,18 +48,11 @@* * Here it is even more important to align src and dst on a 32-bit (or * even better 64-bit) boundary. +* +* this will go away soon. */ extern unsigned int csum_partial_copy (const char *src,char *dst,int len,unsigned int sum); - -/* -* The same as csum_partial, but copies from user space (but on the -* ia-64 we have just one address space, so this is identical to the -* above). -* -* This is obsolete and will go away. -*/ -#define csum_partial_copy_fromuser csum_partial_copy/* * This is a new version of the above that records errors it finds in
include/asm-m68k/checksum.h +2 -0
@@ -21,6 +21,8 @@* * here even more important to align src and dst on a 32-bit (or even * better 64-bit) boundary +* +* this will go away soon. */ unsigned int csum_partial_copy (const char *src,char *dst,int len,int sum);
include/asm-mips/checksum.h +0 -1
@@ -61,7 +61,6 @@* * this is obsolete and will go away. */ -#define csum_partial_copy_fromuser csum_partial_copyunsigned int csum_partial_copy (const char *src,char *dst,int len,unsigned int sum);
include/asm-mips64/checksum.h +0 -1
@@ -63,7 +63,6 @@* * this is obsolete and will go away. */ -#define csum_partial_copy_fromuser csum_partial_copyunsigned int csum_partial_copy (const char *src,char *dst,int len,unsigned int sum);
include/asm-parisc/checksum.h +2 -7
@@ -21,15 +21,10 @@* * here even more important to align src and dst on a 32-bit (or even * better 64-bit) boundary -*/ -extern unsigned int csum_partial_copy (const char *,char *,int ,unsigned int ); - -/* -* the same as csum_partial, but copies from user space * -* this is obsolete and will go away. +* this will go away soon. */ -#define csum_partial_copy_fromuser csum_partial_copy +extern unsigned int csum_partial_copy (const char *,char *,int ,unsigned int );/* * this is a new version of the above that records errors it finds in *errp,
include/asm-ppc/checksum.h +2 -3
@@ -39,11 +39,10 @@#define csum_partial_copy_nocheck (src, dst, len, sum) \ csum_partial_copy_generic((src), (dst), (len), (sum), 0, 0)/* -* Old versions which ignore errors. +* Old version which ignore errors. +* it will go away soon. */ #define csum_partial_copy (src, dst, len, sum) \ - csum_partial_copy_generic((src), (dst), (len), (sum), 0, 0) -#define csum_partial_copy_fromuser (src, dst, len, sum) \ csum_partial_copy_generic((src), (dst), (len), (sum), 0, 0)
include/asm-ppc64/checksum.h +4 -7
@@ -43,6 +43,8 @@/* * the same as csum_partial, but copies from src to dst while it * checksums +* +* csum_partial_copy will go away soon. */ unsigned int csum_partial_copy (const char *src,char *dst,int len,unsigned int sum);
@@ -51,14 +53,9 @@ int len, unsigned int sum, int *src_err, int *dst_err);/* -* the same as csum_partial, but copies from user space. +* the same as csum_partial, but copies from src to dst while it +* checksums. */ - -unsigned int csum_partial_copy_fromuser (const char *src, -char *dst, -int len, -unsigned int sum, -int *src_err); unsigned int csum_partial_copy_nocheck(const char *src, char *dst,
include/asm-s390/checksum.h +2 -0
@@ -67,6 +67,8 @@* * here even more important to align src and dst on a 32-bit (or even * better 64-bit) boundary +* +* this will go away soon. */ static inline unsigned int
include/asm-s390x/checksum.h +2 -0
@@ -69,6 +69,8 @@* * here even more important to align src and dst on a 32-bit (or even * better 64-bit) boundary +* +* this will go away soon. */ static inline unsigned int
include/asm-sh/checksum.h +3 -5
@@ -58,13 +58,11 @@ }/* -* These are the old (and unsafe) way of doing checksums, a warning message will be -* printed if they are used and an exeption occurs. +* This is the old (and unsafe) way of doing checksums, a warning message will +* be printed if it is used and an exeption occurs. * -* these functions should go away after some time. +* this function should go away after some time. */ - -#define csum_partial_copy_fromuser csum_partial_copyunsigned int csum_partial_copy (const char *src,char *dst,int len,int sum);/*
include/asm-sparc/checksum.h +1 -3
@@ -40,11 +40,9 @@* better 64-bit) boundary */ -/* FIXME: Remove these two macros ASAP */ +/* FIXME: Remove this macro ASAP */ #define csum_partial_copy (src, dst, len, sum) \ csum_partial_copy_nocheck(src,dst,len,sum) -#define csum_partial_copy_fromuser (s, d, l, w) \ - csum_partial_copy((char *) (s), (d), (l), (w))extern unsigned int __csum_partial_copy_sparc_generic (const char *,char *);
[email protected], 2002-10-15 10:16:08-07:00, [email protected]
[NET]: Remove final traces of csum_partial_copy.
arch/i386/lib/old-checksum.c deleted +0 -19
@@ -1,19 +0,0 @@ -/* -* FIXME: old compatibility stuff, will be removed soon. -*/ - -#include <net/checksum.h> - -unsigned int csum_partial_copy (const char *src,char *dst,int len,int sum) -{ -int src_err=0 , dst_err=0 ; - - sum =csum_partial_copy_generic ( src, dst, len, sum, &src_err, &dst_err); - -if (src_err || dst_err) -printk ("old csum_partial_copy_fromuser(), tell mingo to convert me.\n" ); - -return sum; -} - -
arch/sh/lib/old-checksum.c deleted +0 -17
@@ -1,17 +0,0 @@ -/* -* FIXME: old compatibility stuff, will be removed soon. -*/ - -#include <net/checksum.h> - -unsigned int csum_partial_copy (const char *src,char *dst,int len,int sum) -{ -int src_err=0 , dst_err=0 ; - - sum =csum_partial_copy_generic ( src, dst, len, sum, &src_err, &dst_err); - -if (src_err || dst_err) -printk ("old csum_partial_copy_fromuser(), tell mingo to convert me.\n" ); - -return sum; -}
[email protected], 2002-10-15 14:06:27-07:00, [email protected]
[TCP]: Handle passive resets correctly in SYN-RECV.
net/ipv4/tcp_minisocks.c +5 -5
@@ -902,13 +902,13 @@* and the incoming segment acknowledges something not yet * sent (the segment carries an unaccaptable ACK) ... * a reset is sent." +* +* Invalid ACK: reset will be sent by listening socket */ -if (!(flg &TCP_FLAG_ACK )) -return NULL ; - -/* Invalid ACK: reset will be sent by listening socket */ -if (TCP_SKB_CB (skb)->ack_seq != req->snt_isn+1 ) +if ((flg &TCP_FLAG_ACK ) && + (TCP_SKB_CB (skb)->ack_seq != req->snt_isn+1 ))return sk; +/* Also, it would be not so bad idea to check rcv_tsecr, which * is essentially ACK extension and too early or too late values * should cause reset in unsynchronized states.
[email protected], 2002-10-15 16:08:26-07:00, [email protected]
[NET]: Export sockfd_lookup.
include/linux/net.h +3 -0
@@ -144,6 +144,9 @@ const struct iovec * iov, long count, long size);extern int sock_map_fd (struct socket *sock); +extern struct socket *sockfd_lookup (int fd,int *err); +#define sockfd_put (sock) fput(sock->file) +extern int net_ratelimit (void );extern unsigned long net_random (void );extern void net_srandom (unsigned long );
net/netsyms.c +1 -0
@@ -161,6 +161,7 @@EXPORT_SYMBOL (sock_kmalloc);EXPORT_SYMBOL (sock_kfree_s);EXPORT_SYMBOL (sock_map_fd); +EXPORT_SYMBOL (sockfd_lookup);#ifdef CONFIG_FILTER EXPORT_SYMBOL (sk_run_filter);
net/socket.c +0 -5
@@ -447,11 +447,6 @@return sock; } -extern __inline__void sockfd_put (struct socket *sock) -{ -fput (sock->file); -} -/** * sock_alloc - allocate a socket *
[email protected], 2002-10-15 19:01:33-07:00, [email protected]
[NET]: Prepare for zerocopy NFS and IPSEC.
- Import va10-hwchecksum-2.5.36.patch
- Import va11-udpsendfile-2.5.36.patch
- Implement new encapsulation friendly ipv4 output path.
include/linux/ip.h +16 -0
@@ -137,7 +137,23 @@int mc_index;/* Multicast device index */ __u32 mc_addr;struct ip_mc_socklist *mc_list;/* Group array */ +struct page *sndmsg_page;/* Cached page for sendmsg */ +u32 sndmsg_off;/* Cached offset for sendmsg */ +/* +* Following members are used to retain the infomation to build +* an ip header on each ip fragmentation while the socket is corked. +*/ +struct { +unsigned int flags; +unsigned int fragsize; +struct ip_options *opt; +struct rtable *rt; +int length;/* Total length of all frames */ +u32 addr; + } cork; }; + +#define IPCORK_OPT 1/* ip-options has been held in ipcork.opt */ struct ipv6_pinfo ;
include/linux/skbuff.h +9 -0
@@ -765,6 +765,15 @@return skb->len - skb->data_len; } +static inline int skb_pagelen (const struct sk_buff *skb) +{ +int i, len =0 ; + +for (i = (int )skb_shinfo (skb)->nr_frags -1 ; i >=0 ; i--) + len +=skb_shinfo (skb)->frags[i].size; +return len +skb_headlen (skb); +} +#define SKB_PAGE_ASSERT (skb) do { if (skb_shinfo(skb)->nr_frags) \ BUG(); } while (0)#define SKB_FRAG_ASSERT (skb) do { if (skb_shinfo(skb)->frag_list) \
include/linux/tcp.h +0 -2
@@ -285,8 +285,6 @@struct tcp_func *af_specific;/* Operations which are AF_INET{4,6} specific */ struct sk_buff *send_head;/* Front of stuff to transmit */ -struct page *sndmsg_page;/* Cached page for sendmsg */ -u32 sndmsg_off;/* Cached offset for sendmsg */ __u32 rcv_wnd;/* Current receiver window */ __u32 rcv_wup;/* rcv_nxt on last window update sent */
include/linux/udp.h +31 -0
@@ -17,6 +17,9 @@ #ifndef _LINUX_UDP_H #define _LINUX_UDP_H +#include <asm/byteorder.h> +#include <net/sock.h> +#include <linux/ip.h> struct udphdr { __u16 source;
@@ -25,5 +28,33 @@ __u16 check; }; +/* UDP socket options */ +#define UDP_CORK 1/* Never send partially complete segments */ + +struct udp_opt { +int pending;/* Any pending frames ? */ +unsigned int corkflag;/* Cork is required */ +/* +* Following members retains the infomation to create a UDP header +* when the socket is uncorked. +*/ +u32 saddr;/* source address */ +u32 daddr;/* destination address */ +__u16 sport;/* source port */ +__u16 dport;/* destination port */ +__u16 len;/* total length of pending frames */ +}; + +/* WARNING: don't change the layout of the members in udp_sock! */ +struct udp_sock { +struct sock sk; +#if defined(CONFIG_IPV6 ) || defined(CONFIG_IPV6_MODULE ) +struct ipv6_pinfo *pinet6; +#endif +struct inet_opt inet; +struct udp_opt udp; +}; + +#define udp_sk (__sk) (&((struct udp_sock *)__sk)->udp)#endif /* _LINUX_UDP_H */
include/net/dst.h +51 -5
87 lines not on this page · raw message
include/net/ip.h +15 -1
@@ -102,12 +102,26 @@int getfrag (const void *,char *,unsigned int , -unsigned int ), +unsigned int , +struct sk_buff *), const void *frag, unsigned length, struct ipcm_cookie *ipc, struct rtable *rt, int flags); +extern int ip_append_data (struct sock *sk, +int getfrag (void *from,char *to,int offset,int len, +int odd,struct sk_buff *skb), +void *from,int len,int protolen, +struct ipcm_cookie *ipc, +struct rtable *rt, +unsigned int flags); +extern int generic_getfrag (void *from,char *to,int offset,int len,int odd,struct sk_buff *skb); +extern ssize_t ip_append_page (struct sock *sk,struct page *page, +int offset,size_t size,int flags); +extern int ip_push_pending_frames (struct sock *sk); +extern void ip_flush_pending_frames (struct sock *sk); +/* * Map a multicast IP onto multicast MAC for type Token Ring.
include/net/sock.h +2 -0
@@ -249,6 +249,8 @@struct msghdr *msg, int len, int noblock, int flags, int *addr_len); +int (*sendpage)(struct sock *sk,struct page *page, +int offset,size_t size,int flags);int (*bind)(struct sock *sk,struct sockaddr *uaddr,int addr_len);
include/net/tcp.h +1 -1
@@ -1851,7 +1851,7 @@ { sk->route_caps = dst->dev->features;if (sk->route_caps &NETIF_F_TSO ) { -if (sk->no_largesend) +if (sk->no_largesend || dst->header_len) sk->route_caps &= ~NETIF_F_TSO ; } }
include/net/udp.h +0 -2
@@ -76,6 +76,4 @@#define UDP_INC_STATS_BH (field) SNMP_INC_STATS_BH(udp_statistics, field)#define UDP_INC_STATS_USER (field) SNMP_INC_STATS_USER(udp_statistics, field) -#define udp_sock inet_sock -#endif /* _UDP_H */
net/core/dst.c +20 -5
@@ -40,7 +40,6 @@static struct timer_list dst_gc_timer = { data:DST_GC_MIN , function: dst_run_gc }; -static void dst_run_gc (unsigned long dummy) {int delayed =0 ;
@@ -60,7 +59,11 @@ delayed++;continue ; } - *dstp = dst->next; +if (dst->child) { + dst->child->next = dst->next; + *dstp = dst->child; + }else + *dstp = dst->next;dst_destroy (dst); }if (!dst_garbage_list) {
@@ -141,10 +144,16 @@spin_unlock_bh (&dst_lock); } -void dst_destroy (struct dst_entry * dst) +struct dst_entry *dst_destroy (struct dst_entry * dst) { -struct neighbour *neigh = dst->neighbour; -struct hh_cache *hh = dst->hh; +struct dst_entry *child; +struct neighbour *neigh; +struct hh_cache *hh; + +again: + neigh = dst->neighbour; + hh = dst->hh; + child = dst->child; dst->hh =NULL ;if (hh &&atomic_dec_and_test (&hh->hh_refcnt))
@@ -165,6 +174,12 @@atomic_dec (&dst_total);#endif kmem_cache_free (dst->ops->kmem_cachep, dst); + + dst = child; +if (dst && !atomic_read (&dst->__refcnt)) + goto again; + +return dst; }static int dst_dev_event (struct notifier_block *this,unsigned long event,void *ptr)
net/ipv4/af_inet.c +16 -1
@@ -774,6 +774,21 @@return sk->prot->sendmsg (iocb, sk, msg, size); } + +ssize_t inet_sendpage (struct socket *sock,struct page *page,int offset,size_t size,int flags) +{ +struct sock *sk = sock->sk; + +/* We may need to bind the socket. */ +if (!inet_sk (sk)->num &&inet_autobind (sk)) +return -EAGAIN ; + +if (sk->prot->sendpage) +return sk->prot->sendpage (sk, page, offset, size, flags); +return sock_no_sendpage (sock, page, offset, size, flags); +} + +int inet_shutdown (struct socket *sock,int how) {struct sock *sk = sock->sk;
@@ -977,7 +992,7 @@ .sendmsg = inet_sendmsg, .recvmsg = inet_recvmsg, .mmap = sock_no_mmap, - .sendpage = sock_no_sendpage, + .sendpage = inet_sendpage, };struct net_proto_family inet_family_ops = {
net/ipv4/icmp.c +3 -1
@@ -357,11 +357,13 @@* checksum. */ static int icmp_glue_bits (const void *p,char *to,unsigned int offset, -unsigned int fraglen) +unsigned int fraglen,struct sk_buff *skb) {struct icmp_bxm *icmp_param = (struct icmp_bxm *)p;struct icmphdr *icmph;unsigned int csum; + + skb->ip_summed =CHECKSUM_NONE ;if (offset) { icmp_param->csum =
net/ipv4/ip_output.c +735 -145
1,101 lines not on this page · raw message
net/ipv4/ip_sockglue.c +3 -1
@@ -437,8 +437,10 @@ (!((1<<sk->state)&(TCPF_LISTEN|TCPF_CLOSE)) && inet->daddr != LOOPBACK4_IPV6)) {#endif +if (inet->opt) + tp->ext_header_len -= inet->opt->optlen;if (opt) - tp->ext_header_len = opt->optlen; + tp->ext_header_len += opt->optlen;tcp_sync_mss (sk, tp->pmtu_cookie);#if defined(CONFIG_IPV6 ) || defined(CONFIG_IPV6_MODULE ) }
net/ipv4/raw.c +5 -2
@@ -259,9 +259,10 @@*/ static int raw_getfrag (const void *p,char *to,unsigned int offset, -unsigned int fraglen) +unsigned int fraglen,struct sk_buff *skb) {struct rawfakehdr *rfh = (struct rawfakehdr *) p; + skb->ip_summed =CHECKSUM_NONE ;/* Is there any good place to set it? */ return memcpy_fromiovecend (to, rfh->iov, offset, fraglen); }
@@ -270,9 +271,11 @@*/ static int raw_getrawfrag (const void *p,char *to,unsigned int offset, -unsigned int fraglen) +unsigned int fraglen,struct sk_buff *skb) {struct rawfakehdr *rfh = (struct rawfakehdr *) p; + + skb->ip_summed =CHECKSUM_NONE ;/* Is there any good place to set it? */ if (memcpy_fromiovecend (to, rfh->iov, offset, fraglen))return -EFAULT ;
net/ipv4/tcp.c +33 -16
82 lines not on this page · raw message
net/ipv4/tcp_ipv4.c +4 -2
@@ -781,6 +781,7 @@__sk_dst_set (sk, &rt->u.dst);tcp_v4_setup_caps (sk, &rt->u.dst); + tp->ext_header_len += rt->u.dst.header_len;if (!inet->opt || !inet->opt->srr) daddr = rt->rt_dst;
@@ -1577,6 +1578,7 @@ newtp->ext_header_len =0 ;if (newinet->opt) newtp->ext_header_len = newinet->opt->optlen; + newtp->ext_header_len += dst->header_len; newinet->id = newtp->write_seq ^ jiffies;tcp_sync_mss (newsk, dst->pmtu);
@@ -2087,8 +2089,8 @@tcp_put_port (sk);/* If sendmsg cached page exists, toss it. */ -if (tp->sndmsg_page) -__free_page (tp->sndmsg_page); +if (inet_sk (sk)->sndmsg_page) +__free_page (inet_sk (sk)->sndmsg_page);atomic_dec (&tcp_sockets_allocated);
net/ipv4/udp.c +289 -7
385 lines not on this page · raw message
net/ipv6/tcp_ipv6.c +3 -2
@@ -1876,6 +1876,7 @@static int tcp_v6_destroy_sock (struct sock *sk) {struct tcp_opt *tp =tcp_sk (sk); +struct inet_opt *inet =inet_sk (sk);tcp_clear_xmit_timers (sk);
@@ -1893,8 +1894,8 @@tcp_put_port (sk);/* If sendmsg cached page exists, toss it. */ -if (tp->sndmsg_page !=NULL ) -__free_page (tp->sndmsg_page); +if (inet->sndmsg_page !=NULL ) +__free_page (inet->sndmsg_page);atomic_dec (&tcp_sockets_allocated);
[email protected], 2002-10-15 19:31:15-07:00, [email protected]
[NET]: Cleanup now that sockfd_lookup/sockfd_put are exported.
- Delete redefinitions of sockfd_{lookup,put}
- Fix socket fd leaks in route ioctl32 code.
arch/ia64/ia32/sys_ia32.c +0 -9
@@ -1664,20 +1664,11 @@ kmsg->msg_control = (void *) orig_cmsg_uptr; } -static inline void -sockfd_put (struct socket *sock) -{ -fput (sock->file); -} -/* XXX This really belongs in some header file... -DaveM */ #define MAX_SOCK_ADDR 128/* 108 for Unix domain - 16 for IP, 16 for IPX, 24 for IPv6, about 80 for AX.25 */ - -extern struct socket *sockfd_lookup (int fd,int *err); -/* * BSD sendmsg interface */
arch/mips64/kernel/linux32.c +0 -8
@@ -2084,19 +2084,11 @@return err; } -extern __inline__void -sockfd_put (struct socket *sock) -{ -fput (sock->file); -} -/* XXX This really belongs in some header file... -DaveM */ #define MAX_SOCK_ADDR 128/* 108 for Unix domain - 16 for IP, 16 for IPX, 24 for IPv6, about 80 for AX.25 */ - -extern struct socket *sockfd_lookup (int fd,int *err);/* * BSD sendmsg interface
arch/ppc64/kernel/ioctl32.c +3 -2
@@ -754,8 +754,6 @@s32 rtmsg_ifindex; }; -extern struct socket *sockfd_lookup (int fd,int *err); -static int routing_ioctl (unsigned int fd,unsigned int cmd,unsigned long arg) {int ret;
@@ -803,6 +801,9 @@set_fs (KERNEL_DS ); ret =sys_ioctl (fd, cmd, (long ) r);set_fs (old_fs); + +if (mysock) +sockfd_put (mysock);return ret; }
arch/ppc64/kernel/sys_ppc32.c +0 -7
@@ -2891,13 +2891,6 @@ __cmsg, __cmsg_len); } -extern struct socket *sockfd_lookup (int fd,int *err); - -extern __inline__void sockfd_put (struct socket *sock) -{ -fput (sock->file); -} -static inline int msghdr_from_user32_to_kern (struct msghdr *kmsg,struct msghdr32 *umsg) {u32 tmp1, tmp2, tmp3;
arch/s390x/kernel/linux32.c +0 -8
@@ -2129,14 +2129,6 @@24 for IPv6, about 80 for AX.25 */ -extern struct socket *sockfd_lookup (int fd,int *err); - -/* XXX This as well... */ -extern __inline__void sockfd_put (struct socket *sock) -{ -fput (sock->file); -} -struct msghdr32 {u32 msg_name;int msg_namelen;
arch/sparc64/kernel/ioctl32.c +3 -2
@@ -797,8 +797,6 @@s32 rtmsg_ifindex; }; -extern struct socket *sockfd_lookup (int fd,int *err); -static int routing_ioctl (unsigned int fd,unsigned int cmd,unsigned long arg) {int ret;
@@ -846,6 +844,9 @@set_fs (KERNEL_DS ); ret =sys_ioctl (fd, cmd, (long ) r);set_fs (old_fs); + +if (mysock) +sockfd_put (mysock);return ret; }
arch/sparc64/kernel/sys_sparc32.c +0 -8
@@ -2133,14 +2133,6 @@24 for IPv6, about 80 for AX.25 */ -extern struct socket *sockfd_lookup (int fd,int *err); - -/* XXX This as well... */ -extern __inline__void sockfd_put (struct socket *sock) -{ -fput (sock->file); -} -struct msghdr32 {u32 msg_name;int msg_namelen;
arch/x86_64/ia32/ia32_ioctl.c +3 -2
@@ -715,8 +715,6 @@s32 rtmsg_ifindex; }; -extern struct socket *sockfd_lookup (int fd,int *err); -static int routing_ioctl (unsigned int fd,unsigned int cmd,unsigned long arg) {int ret;
@@ -764,6 +762,9 @@set_fs (KERNEL_DS ); ret =sys_ioctl (fd, cmd, (long ) r);set_fs (old_fs); + +if (mysock) +sockfd_put (mysock);return ret; }
include/asm-x86_64/socket32.h +0 -8
@@ -7,14 +7,6 @@24 for IPv6, about 80 for AX.25 */ -extern struct socket *sockfd_lookup (int fd,int *err); - -/* XXX This as well... */ -extern __inline__void sockfd_put (struct socket *sock) -{ -fput (sock->file); -} -struct msghdr32 {u32 msg_name;int msg_namelen;
[email protected], 2002-10-15 19:46:59-07:00, [email protected]
arch/sparc64/solaris/socket.c: Kill more sockfd_{lookup,put} redefinitions.
arch/sparc64/solaris/socket.c +0 -25
@@ -248,31 +248,6 @@24 for IPv6, about 80 for AX.25 */ -extern __inline__struct socket *sockfd_lookup (int fd,int *err) -{ -struct file *file; -struct inode *inode; - -if (!(file =fget (fd))) { - *err = -EBADF ; -return NULL ; - } - - inode = file->f_dentry->d_inode; -if (!inode->i_sock) { - *err = -ENOTSOCK ; -fput (file); -return NULL ; - } - -return SOCKET_I (inode); -} - -extern __inline__void sockfd_put (struct socket *sock) -{ -fput (sock->file); -} -struct sol_nmsghdr {u32 msg_name;int msg_namelen;
[email protected], 2002-10-15 20:02:30-07:00, [email protected]
net/ipv4/udp.c: proto sendpage returns int not size_t.
net/ipv4/udp.c +1 -1
@@ -739,7 +739,7 @@ goto out; } -ssize_t udp_sendpage (struct sock *sk,struct page *page,int offset,size_t size,int flags) +int udp_sendpage (struct sock *sk,struct page *page,int offset,size_t size,int flags) {struct udp_opt *up =udp_sk (sk);int ret;
[email protected], 2002-10-15 21:30:57-07:00, [email protected]
net/bluetooth/bnep/sock.c: Kill another sockfd_lookup re-implementation.
net/bluetooth/bnep/sock.c +0 -25
@@ -55,31 +55,6 @@ #define BT_DBG( A... )#endif -static struct socket *sockfd_lookup (int fd,int *err) -{ -struct file *file; -struct inode *inode; -struct socket *sock; - -if (!(file =fget (fd))) { - *err = -EBADF ; -return NULL ; - } - - inode = file->f_dentry->d_inode; -if (!inode->i_sock || !(sock =SOCKET_I (inode))) { - *err = -ENOTSOCK ; -fput (file); -return NULL ; - } - -if (sock->file != file) { -printk (KERN_ERR "socki_lookup: socket file changed!\n" ); - sock->file = file; - } -return sock; -} -static int bnep_sock_release (struct socket *sock) {struct sock *sk = sock->sk;
[email protected], 2002-10-16 03:11:34-03:00, [email protected]
o ipv4: udp seq_file support: produce only one record per seq_show
net/ipv4/ip_proc.c +59 -15
108 lines not on this page · raw message
[email protected], 2002-10-15 23:44:37-07:00, [email protected]
net/ipv4/ip_proc.c: Fix 64-bit warnings.
net/ipv4/ip_proc.c +2 -2
@@ -219,7 +219,7 @@* temporary HACK till we have a solution to * get more state passed to seq_show -acme */ - seq->private = (void *)(int )bucket; + seq->private = (void *)(long )bucket; goto out; } out:
@@ -289,7 +289,7 @@else {char tmpbuf[129 ]; -udp_format_sock (v, tmpbuf, (int )seq->private); +udp_format_sock (v, tmpbuf, (long )seq->private);seq_printf (seq,"%-127s\n" , tmpbuf); }return 0 ;