Re: [patch 01/19] Define functions for page cache handling

2007-12-18 Thread Christoph Lameter
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

Re: [patch 01/19] Define functions for page cache handling

2007-12-03 Thread David Chinner
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

Re: [patch 01/19] Define functions for page cache handling

2007-12-03 Thread Andrew Morton
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

[patch 01/19] Define functions for page cache handling

2007-11-30 Thread Christoph Lameter
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

Re: [patch 01/19] Define functions for page cache handling

2007-11-29 Thread Christoph Lameter
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'? > >

Re: [patch 01/19] Define functions for page cache handling

2007-11-29 Thread Fengguang Wu
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

Re: [patch 01/19] Define functions for page cache handling

2007-11-28 Thread Christoph Lameter
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) > > +{

Re: [patch 01/19] Define functions for page cache handling

2007-11-28 Thread David Chinner
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

[patch 01/19] Define functions for page cache handling

2007-11-28 Thread Christoph Lameter
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