diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-11-12 21:10:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-11-12 21:10:39 -0500 |
commit | 91cf45f02af5c871251165d000c3f42a2a0b0552 (patch) | |
tree | 0e4c0a9f624732d47a46301a394e799dab48afe0 /include/linux | |
parent | 62768e28d606c10ba54217f908123de34dad9374 (diff) |
[NET]: Add the helper kernel_sock_shutdown()
...and fix a couple of bugs in the NBD, CIFS and OCFS2 socket handlers.
Looking at the sock->op->shutdown() handlers, it looks as if all of them
take a SHUT_RD/SHUT_WR/SHUT_RDWR argument instead of the
RCV_SHUTDOWN/SEND_SHUTDOWN arguments.
Add a helper, and then define the SHUT_* enum to ensure that kernel users
of shutdown() don't get confused.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Mark Fasheh <mark.fasheh@oracle.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/net.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index dd79cdb8c4cf..596131ea46f4 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -95,6 +95,12 @@ enum sock_type { | |||
95 | 95 | ||
96 | #endif /* ARCH_HAS_SOCKET_TYPES */ | 96 | #endif /* ARCH_HAS_SOCKET_TYPES */ |
97 | 97 | ||
98 | enum sock_shutdown_cmd { | ||
99 | SHUT_RD = 0, | ||
100 | SHUT_WR = 1, | ||
101 | SHUT_RDWR = 2, | ||
102 | }; | ||
103 | |||
98 | /** | 104 | /** |
99 | * struct socket - general BSD socket | 105 | * struct socket - general BSD socket |
100 | * @state: socket state (%SS_CONNECTED, etc) | 106 | * @state: socket state (%SS_CONNECTED, etc) |
@@ -223,6 +229,8 @@ extern int kernel_setsockopt(struct socket *sock, int level, int optname, | |||
223 | extern int kernel_sendpage(struct socket *sock, struct page *page, int offset, | 229 | extern int kernel_sendpage(struct socket *sock, struct page *page, int offset, |
224 | size_t size, int flags); | 230 | size_t size, int flags); |
225 | extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); | 231 | extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); |
232 | extern int kernel_sock_shutdown(struct socket *sock, | ||
233 | enum sock_shutdown_cmd how); | ||
226 | 234 | ||
227 | #ifndef CONFIG_SMP | 235 | #ifndef CONFIG_SMP |
228 | #define SOCKOPS_WRAPPED(name) name | 236 | #define SOCKOPS_WRAPPED(name) name |