rename try_make_readable() to try_make_writable()

In practice this function makes things readable and writable,
so use a less confusing name.

Test: TreeHugger, 'git grep try_make_readable' comes up empty
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I32faad148cc5714cf0ec7246620376ed4dd3d6d2
This commit is contained in:
Maciej Żenczykowski
2022-04-11 23:29:46 -07:00
parent b3bf5fedab
commit 824fb294ee
3 changed files with 7 additions and 6 deletions

View File

@@ -65,8 +65,9 @@ static inline __always_inline __unused bool is_received_skb(struct __sk_buff* sk
skb->pkt_type == PACKET_MULTICAST;
}
// try to make the first 'len' header bytes readable via direct packet access
static inline __always_inline void try_make_readable(struct __sk_buff* skb, int len) {
// try to make the first 'len' header bytes readable/writable via direct packet access
// (note: AFAIK there is no way to ask for only direct packet read without also getting write)
static inline __always_inline void try_make_writable(struct __sk_buff* skb, int len) {
if (len > skb->len) len = skb->len;
if (skb->data_end - skb->data < len) bpf_skb_pull_data(skb, len);
}