diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-30 18:59:03 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-30 18:59:03 -0800 |
commit | 1ed2d76e0213751c82e3a242b61b0883daf330df (patch) | |
tree | 96c9d5d0fbb9c548ac448dea558b80632c266dc2 /drivers/isdn/mISDN | |
parent | 8b0fdf631cf6a31f60a9ed3e1c0f37a9715de807 (diff) | |
parent | bc4802736d8b17eddde52e00838c348770f67c19 (diff) | |
download | linux-1ed2d76e0213751c82e3a242b61b0883daf330df.tar.gz |
Merge branch 'work.sock_recvmsg' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull kern_recvmsg reduction from Al Viro:
"kernel_recvmsg() is a set_fs()-using wrapper for sock_recvmsg(). In
all but one case that is not needed - use of ITER_KVEC for ->msg_iter
takes care of the data and does not care about set_fs(). The only
exception is svc_udp_recvfrom() where we want cmsg to be store into
kernel object; everything else can just use sock_recvmsg() and be done
with that.
A followup converting svc_udp_recvfrom() away from set_fs() (and
killing kernel_recvmsg() off) is *NOT* in here - I'd like to hear what
netdev folks think of the approach proposed in that followup)"
* 'work.sock_recvmsg' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
tipc: switch to sock_recvmsg()
smc: switch to sock_recvmsg()
ipvs: switch to sock_recvmsg()
mISDN: switch to sock_recvmsg()
drbd: switch to sock_recvmsg()
lustre lnet_sock_read(): switch to sock_recvmsg()
cfs2: switch to sock_recvmsg()
ncpfs: switch to sock_recvmsg()
dlm: switch to sock_recvmsg()
svc_recvfrom(): switch to sock_recvmsg()
Diffstat (limited to 'drivers/isdn/mISDN')
-rw-r--r-- | drivers/isdn/mISDN/l1oip_core.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index e3654782a3e2..21d50e4cc5e1 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -645,8 +645,10 @@ l1oip_socket_thread(void *data) { struct l1oip *hc = (struct l1oip *)data; int ret = 0; - struct msghdr msg; struct sockaddr_in sin_rx; + struct kvec iov; + struct msghdr msg = {.msg_name = &sin_rx, + .msg_namelen = sizeof(sin_rx)}; unsigned char *recvbuf; size_t recvbuf_size = 1500; int recvlen; @@ -661,6 +663,9 @@ l1oip_socket_thread(void *data) goto fail; } + iov.iov_base = recvbuf; + iov.iov_len = recvbuf_size; + /* make daemon */ allow_signal(SIGTERM); @@ -697,12 +702,6 @@ l1oip_socket_thread(void *data) goto fail; } - /* build receive message */ - msg.msg_name = &sin_rx; - msg.msg_namelen = sizeof(sin_rx); - msg.msg_control = NULL; - msg.msg_controllen = 0; - /* build send message */ hc->sendmsg.msg_name = &hc->sin_remote; hc->sendmsg.msg_namelen = sizeof(hc->sin_remote); @@ -719,12 +718,9 @@ l1oip_socket_thread(void *data) printk(KERN_DEBUG "%s: socket created and open\n", __func__); while (!signal_pending(current)) { - struct kvec iov = { - .iov_base = recvbuf, - .iov_len = recvbuf_size, - }; - recvlen = kernel_recvmsg(socket, &msg, &iov, 1, - recvbuf_size, 0); + iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, &iov, 1, + recvbuf_size); + recvlen = sock_recvmsg(socket, &msg, 0); if (recvlen > 0) { l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen); } else { |