[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0806101027220.17093@schroedinger.engr.sgi.com>
Date: Tue, 10 Jun 2008 10:30:36 -0700 (PDT)
From: Christoph Lameter <clameter@....com>
To: Paul Mundt <lethal@...ux-sh.org>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Pekka Enberg <penberg@...helsinki.fi>,
David Howells <dhowells@...hat.com>,
LKML <linux-kernel@...r.kernel.org>, cooloney@...nel.org,
mpm@...enic.com
Subject: Re: [PATCH] nommu: fix kobjsize() for SLOB and SLUB, v2.
On Mon, 2 Jun 2008, Paul Mundt wrote:
> + page = virt_to_head_page(objp);
> + if (!page)
> + return 0;
virt_to_head_page cannot return NULL. virt_to_page also does not return
NULL. pfn_valid() needs to be used to figure out if a page is valid.
Otherwise the page struct reference that was returned may have
PageReserved() set to indicate that it is not a valid page.
> + * The ksize() function is only guaranteed to work for pointers
> + * returned by kmalloc(). So handle arbitrary pointers, that we expect
> + * always to be compound pages, here.
> + */
> + if (PageCompound(page))
> + order = compound_order(page);
compund order returns 0 if you use compound_order() on a
non compound page. No need for the PageCompound test.
--
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