Commit ce3dd395 authored by Jarek Poplawski's avatar Jarek Poplawski Committed by David S. Miller

net: Fix page seeking for skb_splice_bits().

struct page walking should be done with proper accessor functions, not
directly.

With doubts from David S. Miller and Herbert Xu.
Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51621fbd
...@@ -1412,8 +1412,13 @@ static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page, ...@@ -1412,8 +1412,13 @@ static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page,
static inline void __segment_seek(struct page **page, unsigned int *poff, static inline void __segment_seek(struct page **page, unsigned int *poff,
unsigned int *plen, unsigned int off) unsigned int *plen, unsigned int off)
{ {
unsigned long n;
*poff += off; *poff += off;
*page += *poff / PAGE_SIZE; n = *poff / PAGE_SIZE;
if (n)
*page = nth_page(*page, n);
*poff = *poff % PAGE_SIZE; *poff = *poff % PAGE_SIZE;
*plen -= off; *plen -= off;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment