diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-11-07 02:30:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:53:31 -0500 |
commit | 9c55e01c0cc835818475a6ce8c4d684df9949ac8 (patch) | |
tree | 1115311436677f837a4b477e3fd23c5e0ae184ef /net/socket.c | |
parent | bbdfc2f70610bebb841d0874dc901c648308e43a (diff) |
[TCP]: Splice receive support.
Support for network splice receive.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c index 74784dfe8e5b..92fab9e1c602 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -112,6 +112,9 @@ static long compat_sock_ioctl(struct file *file, | |||
112 | static int sock_fasync(int fd, struct file *filp, int on); | 112 | static int sock_fasync(int fd, struct file *filp, int on); |
113 | static ssize_t sock_sendpage(struct file *file, struct page *page, | 113 | static ssize_t sock_sendpage(struct file *file, struct page *page, |
114 | int offset, size_t size, loff_t *ppos, int more); | 114 | int offset, size_t size, loff_t *ppos, int more); |
115 | static ssize_t sock_splice_read(struct file *file, loff_t *ppos, | ||
116 | struct pipe_inode_info *pipe, size_t len, | ||
117 | unsigned int flags); | ||
115 | 118 | ||
116 | /* | 119 | /* |
117 | * Socket files have a set of 'special' operations as well as the generic file ones. These don't appear | 120 | * Socket files have a set of 'special' operations as well as the generic file ones. These don't appear |
@@ -134,6 +137,7 @@ static const struct file_operations socket_file_ops = { | |||
134 | .fasync = sock_fasync, | 137 | .fasync = sock_fasync, |
135 | .sendpage = sock_sendpage, | 138 | .sendpage = sock_sendpage, |
136 | .splice_write = generic_splice_sendpage, | 139 | .splice_write = generic_splice_sendpage, |
140 | .splice_read = sock_splice_read, | ||
137 | }; | 141 | }; |
138 | 142 | ||
139 | /* | 143 | /* |
@@ -691,6 +695,15 @@ static ssize_t sock_sendpage(struct file *file, struct page *page, | |||
691 | return sock->ops->sendpage(sock, page, offset, size, flags); | 695 | return sock->ops->sendpage(sock, page, offset, size, flags); |
692 | } | 696 | } |
693 | 697 | ||
698 | static ssize_t sock_splice_read(struct file *file, loff_t *ppos, | ||
699 | struct pipe_inode_info *pipe, size_t len, | ||
700 | unsigned int flags) | ||
701 | { | ||
702 | struct socket *sock = file->private_data; | ||
703 | |||
704 | return sock->ops->splice_read(sock, ppos, pipe, len, flags); | ||
705 | } | ||
706 | |||
694 | static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb, | 707 | static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb, |
695 | struct sock_iocb *siocb) | 708 | struct sock_iocb *siocb) |
696 | { | 709 | { |