mapping address pointer to page structure

sk.syed2 sk.syed2 at gmail.com
Tue Mar 29 15:40:50 EDT 2011


> .
> struct page *page = virt_to_page(skb->data);
If skb->data page aligned?

> .
> And can some one please tell what is the use of the functions like
> virt_to_page and kmap_atomic_to_page,
Generally to lock the page in memory(esp while doing dma) using get_page().

> i tried calling virt_to_page(skb->data), but when i print the data in the
> page address ( page_address(page) ) and
> the data in pointed by skb->data, i came to know its mapping to a wrong
> page.
  If skb->data is not page aligned then page_address(page) will be
equal to skb->data+(somevalue) (on nearest page boundary).


-syed



More information about the Kernelnewbies mailing list