net: Use skb_frag_off accessors
Use accessor functions for skb fragment's page_offset instead of direct references, in preparation for bvec conversion. Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
7240b60c98
commit
b54c9d5bd6
@@ -1782,12 +1782,12 @@ static int tcp_zerocopy_receive(struct sock *sk,
|
||||
frags++;
|
||||
}
|
||||
}
|
||||
if (skb_frag_size(frags) != PAGE_SIZE || frags->page_offset) {
|
||||
if (skb_frag_size(frags) != PAGE_SIZE || skb_frag_off(frags)) {
|
||||
int remaining = zc->recv_skip_hint;
|
||||
int size = skb_frag_size(frags);
|
||||
|
||||
while (remaining && (size != PAGE_SIZE ||
|
||||
frags->page_offset)) {
|
||||
skb_frag_off(frags))) {
|
||||
remaining -= size;
|
||||
frags++;
|
||||
size = skb_frag_size(frags);
|
||||
@@ -3784,7 +3784,7 @@ int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *hp,
|
||||
|
||||
for (i = 0; i < shi->nr_frags; ++i) {
|
||||
const skb_frag_t *f = &shi->frags[i];
|
||||
unsigned int offset = f->page_offset;
|
||||
unsigned int offset = skb_frag_off(f);
|
||||
struct page *page = skb_frag_page(f) + (offset >> PAGE_SHIFT);
|
||||
|
||||
sg_set_page(&sg, page, skb_frag_size(f),
|
||||
|
@@ -1402,7 +1402,7 @@ static int __pskb_trim_head(struct sk_buff *skb, int len)
|
||||
} else {
|
||||
shinfo->frags[k] = shinfo->frags[i];
|
||||
if (eat) {
|
||||
shinfo->frags[k].page_offset += eat;
|
||||
skb_frag_off_add(&shinfo->frags[k], eat);
|
||||
skb_frag_size_sub(&shinfo->frags[k], eat);
|
||||
eat = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user