struct socket: wait_queue field obsolete in 2.1.51?

Henner Eisen (eis@baty.hanse.de)
Tue, 26 Aug 1997 21:53:07 +0200


Hi,

grepping through the kernel sources I realized that the "wait" field of
struct socket is never used directly anymore (only copied to the
struct sock's sleep field). It seems that the socket inode's "i_wait" field
can be used instead. Patch included. I've tested with tcp and x25, also
compiles and links when all network protocols are enabled).

Or is there any reason why struct socket needs an own wait_queue field?

Henner

diff -u --recursive 2.1.51-i4ldev/include/linux/net.h 2.1.51-ix25/include/linux/net.h
--- 2.1.51-i4ldev/include/linux/net.h Fri Aug 22 20:04:38 1997
+++ 2.1.51-ix25/include/linux/net.h Tue Aug 26 20:38:08 1997
@@ -68,7 +68,6 @@
struct fasync_struct *fasync_list; /* Asynchronous wake up list */
struct file *file; /* File back pointer for gc */
struct sock *sk;
- struct wait_queue *wait;

short type;
unsigned char passcred;
diff -u --recursive 2.1.51-i4ldev/net/core/sock.c 2.1.51-ix25/net/core/sock.c
--- 2.1.51-i4ldev/net/core/sock.c Fri Aug 22 20:03:50 1997
+++ 2.1.51-ix25/net/core/sock.c Tue Aug 26 20:35:50 1997
@@ -906,7 +906,7 @@
if(sock)
{
sk->type = sock->type;
- sk->sleep = &sock->wait;
+ sk->sleep = &sock->inode->i_wait;
sock->sk = sk;
}

diff -u --recursive 2.1.51-i4ldev/net/socket.c 2.1.51-ix25/net/socket.c
--- 2.1.51-i4ldev/net/socket.c Fri Aug 22 20:07:17 1997
+++ 2.1.51-ix25/net/socket.c Tue Aug 26 20:34:44 1997
@@ -289,7 +289,6 @@
inode->i_gid = current->gid;

sock->inode = inode;
- init_waitqueue(&sock->wait);
sock->fasync_list = NULL;
sock->state = SS_UNCONNECTED;
sock->flags = 0;