diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2009-02-12 19:51:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-12 19:51:43 -0500 |
commit | ce3dd39595d9d64f4ba6ee8dd24c6269a3b56b6a (patch) | |
tree | 8efc1a3d7239b37ffd7f51851fc3b4bf734c6c02 /net/core/skbuff.c | |
parent | 51621fbdb1ea8709ab67170b54e71be6d9fa29ad (diff) |
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: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7657cec5973d..ab7d2e9f02fa 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1412,8 +1412,13 @@ static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page, | |||
1412 | static inline void __segment_seek(struct page **page, unsigned int *poff, | 1412 | static inline void __segment_seek(struct page **page, unsigned int *poff, |
1413 | unsigned int *plen, unsigned int off) | 1413 | unsigned int *plen, unsigned int off) |
1414 | { | 1414 | { |
1415 | unsigned long n; | ||
1416 | |||
1415 | *poff += off; | 1417 | *poff += off; |
1416 | *page += *poff / PAGE_SIZE; | 1418 | n = *poff / PAGE_SIZE; |
1419 | if (n) | ||
1420 | *page = nth_page(*page, n); | ||
1421 | |||
1417 | *poff = *poff % PAGE_SIZE; | 1422 | *poff = *poff % PAGE_SIZE; |
1418 | *plen -= off; | 1423 | *plen -= off; |
1419 | } | 1424 | } |