summaryrefslogtreecommitdiff
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorRichard Gobert <richardbgobert@gmail.com>2022-06-22 18:09:03 +0200
committerJakub Kicinski <kuba@kernel.org>2022-06-24 16:24:38 -0700
commitede57d58e6f38d5bc66137368e4a1e68a157af6e (patch)
tree9a412c4d1bbf5865189ee1eba9e926ea3749561e /include/net/sock.h
parent1da9e27415bfc54db25c8374331aaf5321185a1d (diff)
net: helper function skb_len_add
Move the len fields manipulation in the skbs to a helper function. There is a comment specifically requesting this and there are several other areas in the code displaying the same pattern which can be refactored. This improves code readability. Signed-off-by: Richard Gobert <richardbgobert@gmail.com> Link: https://lore.kernel.org/r/20220622160853.GA6478@debian Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 5bed1ea7a722..40bbd0e8925b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2219,9 +2219,7 @@ static inline int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *fro
if (err)
return err;
- skb->len += copy;
- skb->data_len += copy;
- skb->truesize += copy;
+ skb_len_add(skb, copy);
sk_wmem_queued_add(sk, copy);
sk_mem_charge(sk, copy);
return 0;