lkml.org 
[lkml]   [2007]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 4/8] Enhance fallback functions in libs to support higher order pages
On Fri, Apr 20 2007, Christoph Lameter wrote:
> On Fri, 20 Apr 2007, Jens Axboe wrote:
>
> > This works fine as long as you are in the submitter context, but once
> > you pass the into the block layer, we don't have any way to find the
> > address space (at least we don't want to). Would something like this be
> > workable, name withstanding:
> >
> > static unsigned long page_size(struct page *page)
> > {
> > struct address_space *mapping;
> > int order = 0;
> >
> > mapping = page_mapping(page);
> > if (mapping)
> > order = mapping->order;
> >
> > return PAGE_CACHE_SIZE << order;
> > }
>
> There is much simpler solution (possible with mm)
>
> PAGE_SIZE << compound_order(page)
>
> compound_order will return 0 for a non compound page.

Ah perfect, much easier. I'll spin a patchset for the block bits.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-20 18:57    [W:0.136 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site