From patchwork Wed Sep 9 03:21:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 46316 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n893MFAw021016 for ; Wed, 9 Sep 2009 03:22:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752643AbZIIDWF (ORCPT ); Tue, 8 Sep 2009 23:22:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752595AbZIIDWF (ORCPT ); Tue, 8 Sep 2009 23:22:05 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52168 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752279AbZIIDWD (ORCPT ); Tue, 8 Sep 2009 23:22:03 -0400 Received: from relay2.suse.de (relay-ext.suse.de [195.135.221.8]) by mx2.suse.de (Postfix) with ESMTP id F2D3A5FC9F; Wed, 9 Sep 2009 05:22:05 +0200 (CEST) Subject: [PATCH 5/5] xfs: fix xfs to work with Virtually Indexed architectures From: James Bottomley To: Russell King Cc: Parisc List , Linux Filesystem Mailing List , linux-arch@vger.kernel.org, Christoph Hellwig In-Reply-To: <1252466070.13003.365.camel@mulgrave.site> References: <1252434469.13003.3.camel@mulgrave.site> <20090908190031.GF6538@flint.arm.linux.org.uk> <1252437112.13003.39.camel@mulgrave.site> <20090908201619.GG6538@flint.arm.linux.org.uk> <1252442352.13003.132.camel@mulgrave.site> <20090908213910.GH6538@flint.arm.linux.org.uk> <1252466070.13003.365.camel@mulgrave.site> Date: Wed, 09 Sep 2009 03:21:58 +0000 Message-Id: <1252466518.13003.373.camel@mulgrave.site> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1.1 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org xfs_buf.c includes what is essentially a hand rolled version of blk_rq_map_kern(). In order to work properly with the vmalloc buffers that xfs uses, this hand rolled routine must also implement the flushing API for vmap/vmalloc areas. Signed-off-by: James Bottomley --- fs/xfs/linux-2.6/xfs_buf.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 965df12..62ae977 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -1138,6 +1138,10 @@ xfs_buf_bio_end_io( do { struct page *page = bvec->bv_page; + if (is_vmalloc_addr(bp->b_addr)) + invalidate_kernel_dcache_addr(bp->b_addr + + bvec->bv_offset); + ASSERT(!PagePrivate(page)); if (unlikely(bp->b_error)) { if (bp->b_flags & XBF_READ) @@ -1202,6 +1206,9 @@ _xfs_buf_ioapply( bio->bi_end_io = xfs_buf_bio_end_io; bio->bi_private = bp; + if (is_vmalloc_addr(bp->b_addr)) + flush_kernel_dcache_addr(bp->b_addr); + bio_add_page(bio, bp->b_pages[0], PAGE_CACHE_SIZE, 0); size = 0; @@ -1228,6 +1235,9 @@ next_chunk: if (nbytes > size) nbytes = size; + if (is_vmalloc_addr(bp->b_addr)) + flush_kernel_dcache_addr(bp->b_addr + PAGE_SIZE*map_i); + rbytes = bio_add_page(bio, bp->b_pages[map_i], nbytes, offset); if (rbytes < nbytes) break;