lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070420082129.GI6525@kernel.dk>
Date:	Fri, 20 Apr 2007 10:21:29 +0200
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Christoph Lameter <clameter@....com>
Cc:	Adam Litke <aglitke@...il.com>, linux-kernel@...r.kernel.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Nick Piggin <nickpiggin@...oo.com.au>, Andi Kleen <ak@...e.de>,
	Paul Jackson <pj@....com>, Dave Chinner <dgc@....com>
Subject: Re: [RFC 4/8] Enhance fallback functions in libs to support higher  order pages

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 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ