Re: dear list

From: AmÃrico Wang
Date: Thu Oct 14 2010 - 01:14:15 EST


On Thu, Sep 02, 2010 at 02:51:48PM +0800, gaoqiang wrote:
>I'm a newbie and got some question when learning the linux kernel
>
>about a macro:
>
>page_to_pfn(pg)
>
>I traced its definition,and finally got that:
>
>#define __page_to_pfn(page) ((unsigned long)((page) - mem_map) +
>ARCH_PFN_OFFSET)
>
>
>why hot ((unsigned long)((page)-mem_map + ARCH_PFN_OFFSET)/sizeof
>(struct page)
>

Sorry for the really long delay.

That is because both 'page' and 'mem_map' have type 'struct page *'.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/