diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-09-17 21:02:10 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-10-03 20:40:56 -0400 |
commit | 25869262ef7af24ccde988867ac3eb1c3d4b88d4 (patch) | |
tree | b625a7350e316e4fe2033e5689fb0bbc6b3e2973 /net/unix/af_unix.c | |
parent | 79fddc4efd5d4de5cf210fe5ecf4d2734140849a (diff) |
skb_splice_bits(): get rid of callback
since pipe_lock is the outermost now, we don't need to drop/regain
socket locks around the call of splice_to_pipe() from skb_splice_bits(),
which kills the need to have a socket-specific callback; we can just
call splice_to_pipe() and be done with that.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 8309687a56b0..145082e2ba36 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -2475,28 +2475,13 @@ static int unix_stream_recvmsg(struct socket *sock, struct msghdr *msg, | |||
2475 | return unix_stream_read_generic(&state); | 2475 | return unix_stream_read_generic(&state); |
2476 | } | 2476 | } |
2477 | 2477 | ||
2478 | static ssize_t skb_unix_socket_splice(struct sock *sk, | ||
2479 | struct pipe_inode_info *pipe, | ||
2480 | struct splice_pipe_desc *spd) | ||
2481 | { | ||
2482 | int ret; | ||
2483 | struct unix_sock *u = unix_sk(sk); | ||
2484 | |||
2485 | mutex_unlock(&u->iolock); | ||
2486 | ret = splice_to_pipe(pipe, spd); | ||
2487 | mutex_lock(&u->iolock); | ||
2488 | |||
2489 | return ret; | ||
2490 | } | ||
2491 | |||
2492 | static int unix_stream_splice_actor(struct sk_buff *skb, | 2478 | static int unix_stream_splice_actor(struct sk_buff *skb, |
2493 | int skip, int chunk, | 2479 | int skip, int chunk, |
2494 | struct unix_stream_read_state *state) | 2480 | struct unix_stream_read_state *state) |
2495 | { | 2481 | { |
2496 | return skb_splice_bits(skb, state->socket->sk, | 2482 | return skb_splice_bits(skb, state->socket->sk, |
2497 | UNIXCB(skb).consumed + skip, | 2483 | UNIXCB(skb).consumed + skip, |
2498 | state->pipe, chunk, state->splice_flags, | 2484 | state->pipe, chunk, state->splice_flags); |
2499 | skb_unix_socket_splice); | ||
2500 | } | 2485 | } |
2501 | 2486 | ||
2502 | static ssize_t unix_stream_splice_read(struct socket *sock, loff_t *ppos, | 2487 | static ssize_t unix_stream_splice_read(struct socket *sock, loff_t *ppos, |