diff options
author | Florian Westphal <fw@strlen.de> | 2020-02-26 12:14:50 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-27 07:46:26 +0300 |
commit | bfae9dae449d5eeb196a071fe4720504362672b4 (patch) | |
tree | 716597da8cac7b67a7632a4f2c78b8b371e3940a /net/mptcp/subflow.c | |
parent | 600911ff5f72baeac3fc6a9532ec8ba949cd818a (diff) | |
download | linux-bfae9dae449d5eeb196a071fe4720504362672b4.tar.xz |
mptcp: remove mptcp_read_actor
Only used to discard stale data from the subflow, so move
it where needed.
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/subflow.c')
-rw-r--r-- | net/mptcp/subflow.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 3dad662840aa..37a4767db441 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -408,6 +408,18 @@ validate_seq: return MAPPING_OK; } +static int subflow_read_actor(read_descriptor_t *desc, + struct sk_buff *skb, + unsigned int offset, size_t len) +{ + size_t copy_len = min(desc->count, len); + + desc->count -= copy_len; + + pr_debug("flushed %zu bytes, %zu left", copy_len, desc->count); + return copy_len; +} + static bool subflow_check_data_avail(struct sock *ssk) { struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk); @@ -482,16 +494,12 @@ static bool subflow_check_data_avail(struct sock *ssk) pr_debug("discarding %zu bytes, current map len=%d", delta, map_remaining); if (delta) { - struct mptcp_read_arg arg = { - .msg = NULL, - }; read_descriptor_t desc = { .count = delta, - .arg.data = &arg, }; int ret; - ret = tcp_read_sock(ssk, &desc, mptcp_read_actor); + ret = tcp_read_sock(ssk, &desc, subflow_read_actor); if (ret < 0) { ssk->sk_err = -ret; goto fatal; |