[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20101014051833.GA5167@cr0.nay.redhat.com>
Date: Thu, 14 Oct 2010 13:18:33 +0800
From: Américo Wang <xiyou.wangcong@...il.com>
To: gaoqiang <834555262@...com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: dear list
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists