From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: [patch 19/19] Use page_cache_xxx in drivers/block/rd.c Date: Fri, 30 Nov 2007 09:35:07 -0800 Message-ID: <20071130173510.887469642@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 relay1.sgi.com ([192.48.171.29]:42932 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1763085AbXK3RfS (ORCPT ); Fri, 30 Nov 2007 12:35:18 -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=0020-Use-page_cache_xxx-in-drivers-block-rd.c.patch Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Use page_cache_xxx in drivers/block/rd.c Reviewed-by: Dave Chinner Signed-off-by: Christoph Lameter --- drivers/block/rd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: mm/drivers/block/rd.c =================================================================== --- mm.orig/drivers/block/rd.c 2007-11-28 16:54:34.007439863 -0800 +++ mm/drivers/block/rd.c 2007-11-29 11:23:58.900823092 -0800 @@ -122,7 +122,7 @@ static void make_page_uptodate(struct pa } } while ((bh = bh->b_this_page) != head); } else { - memset(page_address(page), 0, PAGE_CACHE_SIZE); + memset(page_address(page), 0, page_cache_size(page_mapping(page))); } flush_dcache_page(page); SetPageUptodate(page); @@ -215,9 +215,9 @@ static const struct address_space_operat static int rd_blkdev_pagecache_IO(int rw, struct bio_vec *vec, sector_t sector, struct address_space *mapping) { - pgoff_t index = sector >> (PAGE_CACHE_SHIFT - 9); + pgoff_t index = sector >> (page_cache_shift(mapping) - 9); unsigned int vec_offset = vec->bv_offset; - int offset = (sector << 9) & ~PAGE_CACHE_MASK; + int offset = page_cache_offset(mapping, (sector << 9)); int size = vec->bv_len; int err = 0; @@ -227,7 +227,7 @@ static int rd_blkdev_pagecache_IO(int rw char *src; char *dst; - count = PAGE_CACHE_SIZE - offset; + count = page_cache_size(mapping) - offset; if (count > size) count = size; size -= count; --