diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-12 17:49:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-12 17:49:50 -0400 |
commit | 5166701b368caea89d57b14bf41cf39e819dad51 (patch) | |
tree | c73b9d4860809e3afa9359be9d03ba2d8d98a18e /fs/ocfs2/cluster/tcp.c | |
parent | 0a7418f5f569512e98789c439198eed4b507cce3 (diff) | |
parent | a786c06d9f2719203c00b3d97b21f9a96980d0b5 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro:
"The first vfs pile, with deep apologies for being very late in this
window.
Assorted cleanups and fixes, plus a large preparatory part of iov_iter
work. There's a lot more of that, but it'll probably go into the next
merge window - it *does* shape up nicely, removes a lot of
boilerplate, gets rid of locking inconsistencie between aio_write and
splice_write and I hope to get Kent's direct-io rewrite merged into
the same queue, but some of the stuff after this point is having
(mostly trivial) conflicts with the things already merged into
mainline and with some I want more testing.
This one passes LTP and xfstests without regressions, in addition to
usual beating. BTW, readahead02 in ltp syscalls testsuite has started
giving failures since "mm/readahead.c: fix readahead failure for
memoryless NUMA nodes and limit readahead pages" - might be a false
positive, might be a real regression..."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits)
missing bits of "splice: fix racy pipe->buffers uses"
cifs: fix the race in cifs_writev()
ceph_sync_{,direct_}write: fix an oops on ceph_osdc_new_request() failure
kill generic_file_buffered_write()
ocfs2_file_aio_write(): switch to generic_perform_write()
ceph_aio_write(): switch to generic_perform_write()
xfs_file_buffered_aio_write(): switch to generic_perform_write()
export generic_perform_write(), start getting rid of generic_file_buffer_write()
generic_file_direct_write(): get rid of ppos argument
btrfs_file_aio_write(): get rid of ppos
kill the 5th argument of generic_file_buffered_write()
kill the 4th argument of __generic_file_aio_write()
lustre: don't open-code kernel_recvmsg()
ocfs2: don't open-code kernel_recvmsg()
drbd: don't open-code kernel_recvmsg()
constify blk_rq_map_user_iov() and friends
lustre: switch to kernel_sendmsg()
ocfs2: don't open-code kernel_sendmsg()
take iov_iter stuff to mm/iov_iter.c
process_vm_access: tidy up a bit
...
Diffstat (limited to 'fs/ocfs2/cluster/tcp.c')
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 49 |
1 files changed, 11 insertions, 38 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index eb649d23a4de..dfda2ffdb16c 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -916,57 +916,30 @@ 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, |
940 | size_t veclen, size_t total) | 925 | size_t veclen, size_t total) |
941 | { | 926 | { |
942 | int ret; | 927 | int ret; |
943 | mm_segment_t oldfs; | 928 | struct msghdr msg; |
944 | struct msghdr msg = { | ||
945 | .msg_iov = (struct iovec *)vec, | ||
946 | .msg_iovlen = veclen, | ||
947 | }; | ||
948 | 929 | ||
949 | if (sock == NULL) { | 930 | if (sock == NULL) { |
950 | ret = -EINVAL; | 931 | ret = -EINVAL; |
951 | goto out; | 932 | goto out; |
952 | } | 933 | } |
953 | 934 | ||
954 | oldfs = get_fs(); | 935 | ret = kernel_sendmsg(sock, &msg, vec, veclen, total); |
955 | set_fs(get_ds()); | 936 | if (likely(ret == total)) |
956 | ret = sock_sendmsg(sock, &msg, total); | 937 | return 0; |
957 | set_fs(oldfs); | 938 | mlog(ML_ERROR, "sendmsg returned %d instead of %zu\n", ret, total); |
958 | if (ret != total) { | 939 | if (ret >= 0) |
959 | mlog(ML_ERROR, "sendmsg returned %d instead of %zu\n", ret, | 940 | ret = -EPIPE; /* should be smarter, I bet */ |
960 | total); | ||
961 | if (ret >= 0) | ||
962 | ret = -EPIPE; /* should be smarter, I bet */ | ||
963 | goto out; | ||
964 | } | ||
965 | |||
966 | ret = 0; | ||
967 | out: | 941 | out: |
968 | if (ret < 0) | 942 | mlog(0, "returning error: %d\n", ret); |
969 | mlog(0, "returning error: %d\n", ret); | ||
970 | return ret; | 943 | return ret; |
971 | } | 944 | } |
972 | 945 | ||