On Wed, Nov 28, 2007 at 05:11:06PM -0800, Christoph Lameter wrote:
> Use page_cache_xxx functions in fs/ext2/*
> 
> Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]>
> ---
>  fs/ext2/dir.c |   40 +++++++++++++++++++++++-----------------
>  1 file changed, 23 insertions(+), 17 deletions(-)
> 
> Index: linux-2.6/fs/ext2/dir.c
> ===================================================================
> --- linux-2.6.orig/fs/ext2/dir.c      2007-11-26 17:45:29.155116723 -0800
> +++ linux-2.6/fs/ext2/dir.c   2007-11-26 18:15:08.660772219 -0800
> @@ -63,7 +63,8 @@ static inline void ext2_put_page(struct 
>  
>  static inline unsigned long dir_pages(struct inode *inode)
>  {
> -     return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
> +     return (inode->i_size+page_cache_size(inode->i_mapping)-1)>>
> +                     page_cache_shift(inode->i_mapping);
>  }

        return page_cache_next(inode->mapping, inode->i_size);
>  
>  /*
> @@ -74,10 +75,11 @@ static unsigned
>  ext2_last_byte(struct inode *inode, unsigned long page_nr)
>  {
>       unsigned last_byte = inode->i_size;
> +     struct address_space *mapping = inode->i_mapping;
>  
> -     last_byte -= page_nr << PAGE_CACHE_SHIFT;
> -     if (last_byte > PAGE_CACHE_SIZE)
> -             last_byte = PAGE_CACHE_SIZE;
> +     last_byte -= page_nr << page_cache_shift(mapping);

        last_byte -= page_cache_pos(mapping, page_nr, 0);

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to