diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-02-08 21:09:07 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-01 23:19:32 -0400 |
commit | 920220c11122952061f2d81a9f06ca077bb744d9 (patch) | |
tree | 74ff3534d1aa505bdb6f896e8c85f2ca00e94545 /fs | |
parent | f730c848affc05fb7262574b06e0cd7e1fa96096 (diff) |
ocfs2: don't open-code kernel_recvmsg()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 68d80c316381..ea63d6461f55 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -916,24 +916,9 @@ static struct o2net_msg_handler *o2net_handler_get(u32 msg_type, u32 key) | |||
916 | 916 | ||
917 | static int o2net_recv_tcp_msg(struct socket *sock, void *data, size_t len) | 917 | static int o2net_recv_tcp_msg(struct socket *sock, void *data, size_t len) |
918 | { | 918 | { |
919 | int ret; | 919 | struct kvec vec = { .iov_len = len, .iov_base = data, }; |
920 | mm_segment_t oldfs; | 920 | struct msghdr msg = { .msg_flags = MSG_DONTWAIT, }; |
921 | struct kvec vec = { | 921 | return kernel_recvmsg(sock, &msg, &vec, 1, len, msg.msg_flags); |
922 | .iov_len = len, | ||
923 | .iov_base = data, | ||
924 | }; | ||
925 | struct msghdr msg = { | ||
926 | .msg_iovlen = 1, | ||
927 | .msg_iov = (struct iovec *)&vec, | ||
928 | .msg_flags = MSG_DONTWAIT, | ||
929 | }; | ||
930 | |||
931 | oldfs = get_fs(); | ||
932 | set_fs(get_ds()); | ||
933 | ret = sock_recvmsg(sock, &msg, len, msg.msg_flags); | ||
934 | set_fs(oldfs); | ||
935 | |||
936 | return ret; | ||
937 | } | 922 | } |
938 | 923 | ||
939 | static int o2net_send_tcp_msg(struct socket *sock, struct kvec *vec, | 924 | static int o2net_send_tcp_msg(struct socket *sock, struct kvec *vec, |