From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: [20/41] Use page_cache_xxx in drivers/block/rd.c Date: Mon, 10 Sep 2007 23:04:10 -0700 Message-ID: <20070911060429.946061623@sgi.com> References: <20070911060349.993975297@sgi.com> Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: torvalds@linux-foundation.org Return-path: Received: from netops-testserver-4-out.sgi.com ([192.48.171.29]:56498 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1761202AbXIKGEc (ORCPT ); Tue, 11 Sep 2007 02:04:32 -0400 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 Signed-off-by: Christoph Lameter --- drivers/block/rd.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/rd.c b/drivers/block/rd.c index 65150b5..e148b3b 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c @@ -121,7 +121,7 @@ static void make_page_uptodate(struct page *page) } } 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); @@ -201,9 +201,9 @@ static const struct address_space_operations ramdisk_aops = { 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_size(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; @@ -213,7 +213,7 @@ static int rd_blkdev_pagecache_IO(int rw, struct bio_vec *vec, sector_t sector, char *src; char *dst; - count = PAGE_CACHE_SIZE - offset; + count = page_cache_size(mapping) - offset; if (count > size) count = size; size -= count; -- 1.5.2.5 --