]> git.baikalelectronics.ru Git - kernel.git/commit
af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()
authorChangli Gao <xiaosuo@gmail.com>
Wed, 1 Dec 2010 02:52:20 +0000 (02:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Dec 2010 20:59:06 +0000 (12:59 -0800)
commitf639b9baa2f2d4e10b264829541ef21b5f306be7
treeb91fb024121975b3897d2132da744abe288be378
parent6389e5f312e1ddecb1cade7e3ca76077588185ff
af_packet: use vmalloc_to_page() instead for the addresss returned by vmalloc()

The following commit causes the pgv->buffer may point to the memory
returned by vmalloc(). And we can't use virt_to_page() for the vmalloc
address.

This patch introduces a new inline function pgv_to_page(), which calls
vmalloc_to_page() for the vmalloc address, and virt_to_page() for the
__get_free_pages address.

We used to increase page pointer to get the next page at the next page
address, after Neil's patch, it is wrong, as the physical address may
be not continuous. This patch also fixes this issue.

    commit b34f1cc90bcded0a2f51e9053d13fc09cb2262c0
    Author: Neil Horman <nhorman@tuxdriver.com>
    Date:   Tue Nov 16 10:26:47 2010 -0800

    packet: Enhance AF_PACKET implementation to not require high order contiguous memory allocation (v4)

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c