On Thu, Apr 19 2007, Christoph Lameter wrote:
> +static inline int page_cache_shift(struct address_space *a)
> +{
> + return a->order + PAGE_CACHE_SHIFT;
> +}
> +
> +static inline unsigned long page_cache_size(struct address_space *a)
> +{
> + return PAGE_CACHE_SIZE << a->order;
> +}
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;
}
--
Jens Axboe
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]