[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <480646B2.9000905@redhat.com>
Date: Wed, 16 Apr 2008 14:34:26 -0400
From: Masami Hiramatsu <mhiramat@...hat.com>
To: Pekka J Enberg <penberg@...helsinki.fi>
CC: Tom Zanussi <zanussi@...cast.net>,
David Wilder <dwilder@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
systemtap-ml <systemtap@...rces.redhat.com>,
LKML <linux-kernel@...r.kernel.org>, tzanussi@...il.com
Subject: Re: [PATCH -mm] relayfs: support larger relay buffer take 2
Hi,
Pekka J Enberg wrote:
> Hi Masami,
>
> On Wed, 16 Apr 2008, Masami Hiramatsu wrote:
>> +static struct page *relay_alloc_page_array(unsigned int n_pages)
>> +{
>> + struct page *array;
>> + unsigned int pa_size = n_pages * sizeof(struct page *);
>> +
>> + if (pa_size > PAGE_SIZE) {
>> + array = vmalloc(pa_size);
>> + if (array)
>> + memset(array, 0, pa_size);
>> + } else {
>> + array = kcalloc(n_pages, sizeof(struct page *), GFP_KERNEL);
>> + }
>> + return array;
>> +}
>
> I think it's bit confusing to have relay_alloc_page_array() return a
> pointer to struct page as it's really allocating an _array_ of pointers to
> struct page. So why not just use void * here as the kernel memory
> allocators do?
Thank you very much, it was my mistake.
It should return struct page **.
>> +static void relay_free_page_array(struct page *array)
>> +{
>> + if (is_vmalloc_addr(array))
>> + vfree(array);
>> + else
>> + kfree(array);
>> +}
>
> Here as well.
Thanks,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@...hat.com
--
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