From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: [patch 12/19] Use page_cache_xxx in mm/fadvise.c Date: Fri, 30 Nov 2007 09:35:00 -0800 Message-ID: <20071130173508.889648113@sgi.com> References: <20071130173448.951783014@sgi.com> Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org To: akpm@linux-foundation.org Return-path: Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:58321 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760323AbXK3RfL (ORCPT ); Fri, 30 Nov 2007 12:35:11 -0500 Cc: Christoph Hellwig , Mel Gorman Cc: William Lee Irwin III , David Chinner Cc: Jens Axboe , Badari Pulavarty Cc: Maxim Levitsky , Fengguang Wu Cc: swin wang , totty.lu@gmail.com, hugh@veritas.com Cc: joern@lazybastard.org Content-Disposition: inline; filename=0013-Use-page_cache_xxx-in-mm-fadvise.c.patch Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Use page_cache_xxx in mm/fadvise.c Reviewed-by: Dave Chinner Signed-off-by: Christoph Lameter --- mm/fadvise.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: mm/mm/fadvise.c =================================================================== --- mm.orig/mm/fadvise.c 2007-11-29 11:24:21.818866688 -0800 +++ mm/mm/fadvise.c 2007-11-29 11:28:23.520116366 -0800 @@ -79,8 +79,8 @@ asmlinkage long sys_fadvise64_64(int fd, } /* First and last PARTIAL page! */ - start_index = offset >> PAGE_CACHE_SHIFT; - end_index = endbyte >> PAGE_CACHE_SHIFT; + start_index = page_cache_index(mapping, offset); + end_index = page_cache_index(mapping, endbyte); /* Careful about overflow on the "+1" */ nrpages = end_index - start_index + 1; @@ -100,8 +100,8 @@ asmlinkage long sys_fadvise64_64(int fd, filemap_flush(mapping); /* First and last FULL page! */ - start_index = (offset+(PAGE_CACHE_SIZE-1)) >> PAGE_CACHE_SHIFT; - end_index = (endbyte >> PAGE_CACHE_SHIFT); + start_index = page_cache_next(mapping, offset); + end_index = page_cache_index(mapping, endbyte); if (end_index >= start_index) invalidate_mapping_pages(mapping, start_index, --