On Mon, 3 Dec 2007, Andrew Morton wrote:
> These will of course all work OK as they are presently implemented.
>
> But you have callsites doing things like
>
> page_cache_size(page_mapping(page));
>
> which is a whole different thing. Once page_cache_size() is changed to
> look inside th
On Mon, Dec 03, 2007 at 02:10:20PM -0800, Andrew Morton wrote:
> On Fri, 30 Nov 2007 09:34:49 -0800
> Christoph Lameter <[EMAIL PROTECTED]> wrote:
>
> > We use the macros PAGE_CACHE_SIZE PAGE_CACHE_SHIFT PAGE_CACHE_MASK
> > and PAGE_CACHE_ALIGN in various places in the kernel. Many times
> > commo
On Fri, 30 Nov 2007 09:34:49 -0800
Christoph Lameter <[EMAIL PROTECTED]> wrote:
> We use the macros PAGE_CACHE_SIZE PAGE_CACHE_SHIFT PAGE_CACHE_MASK
> and PAGE_CACHE_ALIGN in various places in the kernel. Many times
> common operations like calculating the offset or the index are coded
> using shi
We use the macros PAGE_CACHE_SIZE PAGE_CACHE_SHIFT PAGE_CACHE_MASK
and PAGE_CACHE_ALIGN in various places in the kernel. Many times
common operations like calculating the offset or the index are coded
using shifts and adds. This patch provides inline functions to
get the calculations accomplished w
On Thu, 29 Nov 2007, Fengguang Wu wrote:
> On Wed, Nov 28, 2007 at 05:10:53PM -0800, Christoph Lameter wrote:
> > +static inline loff_t page_cache_mask(struct address_space *a)
> > +{
> > + return (loff_t)PAGE_MASK;
> > +}
>
> A tiny question: Why choose loff_t instead of 'unsigned long'?
>
>
On Wed, Nov 28, 2007 at 05:10:53PM -0800, Christoph Lameter wrote:
> +static inline loff_t page_cache_mask(struct address_space *a)
> +{
> + return (loff_t)PAGE_MASK;
> +}
A tiny question: Why choose loff_t instead of 'unsigned long'?
It's not obvious because page_cache_mask() is not referenc
On Thu, 29 Nov 2007, David Chinner wrote:
> On Wed, Nov 28, 2007 at 05:10:53PM -0800, Christoph Lameter wrote:
> > +/*
> > + * Index of the page starting on or after the given position.
> > + */
> > +static inline pgoff_t page_cache_next(struct address_space *a,
> > + loff_t pos)
> > +{
On Wed, Nov 28, 2007 at 05:10:53PM -0800, Christoph Lameter wrote:
> +/*
> + * Index of the page starting on or after the given position.
> + */
> +static inline pgoff_t page_cache_next(struct address_space *a,
> + loff_t pos)
> +{
> + return page_cache_index(a, pos + page_cache_siz
We use the macros PAGE_CACHE_SIZE PAGE_CACHE_SHIFT PAGE_CACHE_MASK
and PAGE_CACHE_ALIGN in various places in the kernel. Many times
common operations like calculating the offset or the index are coded
using shifts and adds. This patch provides inline functions to
get the calculations accomplished w