Re: [PATCH -mm 2/10][RFC] aio: net use struct socket for io

2007-01-16 Thread Evgeniy Polyakov
On Mon, Jan 15, 2007 at 09:44:27PM -0800, Stephen Hemminger ([EMAIL PROTECTED]) 
wrote:
  The sendmsg and recvmsg socket operations take a kiocb pointer, but none of
  the functions actually use it.  There's really no need even theoretically,
  it's really quite ugly having it there at all.  Also, removing it will pave
  the way for a more generic completion path in the file_operations.
  
  ---
 
 Would getting rid of these make later implementation of AIO networking
 harder?

Depending on what AIO it will be.
Mainstream AIO does stand on kiocb, but if socket operations will be
extended to have additional async_read/write (like it as done in kevent
AIO) there is no need to have this pointer in sync operations (until
people want to have sync aio just as async with waiting for completion).

So, real question is, what next - how network AIO will be implemented?

-- 
Evgeniy Polyakov
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH -mm 2/10][RFC] aio: net use struct socket for io

2007-01-15 Thread Nate Diller
Remove unused arg from socket operations

The sendmsg and recvmsg socket operations take a kiocb pointer, but none of
the functions actually use it.  There's really no need even theoretically,
it's really quite ugly having it there at all.  Also, removing it will pave
the way for a more generic completion path in the file_operations.

---

 drivers/net/pppoe.c   |8 +++
 include/linux/net.h   |   18 +++--
 include/net/bluetooth/bluetooth.h |2 -
 include/net/inet_common.h |3 --
 include/net/sock.h|   19 --
 include/net/tcp.h |6 ++---
 include/net/udp.h |3 --
 net/appletalk/ddp.c   |5 +---
 net/atm/common.c  |6 +
 net/atm/common.h  |7 ++
 net/ax25/af_ax25.c|7 ++
 net/bluetooth/af_bluetooth.c  |4 +--
 net/bluetooth/hci_sock.c  |7 ++
 net/bluetooth/l2cap.c |2 -
 net/bluetooth/rfcomm/sock.c   |8 +++
 net/bluetooth/sco.c   |3 --
 net/core/sock.c   |   12 ---
 net/dccp/dccp.h   |8 +++
 net/dccp/probe.c  |3 --
 net/dccp/proto.c  |7 ++
 net/decnet/af_decnet.c|7 ++
 net/econet/af_econet.c|7 ++
 net/ipv4/af_inet.c|5 +---
 net/ipv4/raw.c|8 ++-
 net/ipv4/tcp.c|7 ++
 net/ipv4/tcp_probe.c  |3 --
 net/ipv4/udp.c|9 +++-
 net/ipv4/udp_impl.h   |2 -
 net/ipv6/raw.c|6 +
 net/ipv6/udp.c|   10 +++--
 net/ipv6/udp_impl.h   |6 +
 net/ipx/af_ipx.c  |7 ++
 net/irda/af_irda.c|   29 +---
 net/key/af_key.c  |6 +
 net/llc/af_llc.c  |7 ++
 net/netlink/af_netlink.c  |6 +
 net/netrom/af_netrom.c|7 ++
 net/packet/af_packet.c|   11 --
 net/rose/af_rose.c|7 ++
 net/sctp/socket.c |9 +++-
 net/socket.c  |   32 ++-
 net/tipc/socket.c |   28 +--
 net/unix/af_unix.c|   39 +++---
 net/wanrouter/af_wanpipe.c|7 ++
 net/x25/af_x25.c  |6 +
 45 files changed, 166 insertions(+), 243 deletions(-)

---

diff -urpN -X dontdiff a/drivers/net/pppoe.c b/drivers/net/pppoe.c
--- a/drivers/net/pppoe.c   2007-01-12 11:18:47.244855016 -0800
+++ b/drivers/net/pppoe.c   2007-01-12 11:29:21.179177108 -0800
@@ -746,8 +746,8 @@ static int pppoe_ioctl(struct socket *so
 }
 
 
-static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
- struct msghdr *m, size_t total_len)
+static int pppoe_sendmsg(struct socket *sock, struct msghdr *m,
+size_t total_len)
 {
struct sk_buff *skb = NULL;
struct sock *sk = sock-sk;
@@ -912,8 +912,8 @@ static struct ppp_channel_ops pppoe_chan
.start_xmit = pppoe_xmit,
 };
 
-static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
- struct msghdr *m, size_t total_len, int flags)
+static int pppoe_recvmsg(struct socket *sock, struct msghdr *m,
+size_t total_len, int flags)
 {
struct sock *sk = sock-sk;
struct sk_buff *skb = NULL;
diff -urpN -X dontdiff a/include/linux/net.h b/include/linux/net.h
--- a/include/linux/net.h   2007-01-12 11:18:56.683629587 -0800
+++ b/include/linux/net.h   2007-01-12 11:29:21.185175058 -0800
@@ -118,7 +118,6 @@ struct socket {
 
 struct vm_area_struct;
 struct page;
-struct kiocb;
 struct sockaddr;
 struct msghdr;
 struct module;
@@ -156,11 +155,10 @@ struct proto_ops {
  int optname, char __user *optval, int 
optlen);
int (*compat_getsockopt)(struct socket *sock, int level,
  int optname, char __user *optval, int 
__user *optlen);
-   int (*sendmsg)   (struct kiocb *iocb, struct socket *sock,
- struct msghdr *m, size_t total_len);
-   int (*recvmsg)   (struct kiocb *iocb, struct socket *sock,
- struct msghdr *m, size_t total_len,
- int flags);
+   int (*sendmsg)   (struct socket *sock, struct msghdr *m,
+ size_t total_len);
+   int (*recvmsg)   (struct socket *sock, struct msghdr *m,
+ size_t total_len, int flags);
int