From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <20071227053402.342122380@sgi.com> References: <20071227053246.902699851@sgi.com> Date: Wed, 26 Dec 2007 21:32:58 -0800 From: Christoph Lameter Subject: [patch 12/18] Use page_cache_xxx in mm/fadvise.c Content-Disposition: inline; filename=0013-Use-page_cache_xxx-in-mm-fadvise.c.patch Sender: owner-linux-mm@kvack.org Return-Path: To: akpm@linux-foundation.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, David Chinner List-ID: 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: linux-2.6.24-rc6-mm1/mm/fadvise.c =================================================================== --- linux-2.6.24-rc6-mm1.orig/mm/fadvise.c 2007-12-20 17:25:48.000000000 -0800 +++ linux-2.6.24-rc6-mm1/mm/fadvise.c 2007-12-26 19:51:07.918144462 -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, -- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org