From patchwork Wed Apr 4 19:18:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 10323221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 80B9E60390 for ; Wed, 4 Apr 2018 19:28:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7153C26E90 for ; Wed, 4 Apr 2018 19:28:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6605F28174; Wed, 4 Apr 2018 19:28:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8AB626E90 for ; Wed, 4 Apr 2018 19:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752081AbeDDT2A (ORCPT ); Wed, 4 Apr 2018 15:28:00 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54010 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751869AbeDDTTR (ORCPT ); Wed, 4 Apr 2018 15:19:17 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 48DFE4072CF7; Wed, 4 Apr 2018 19:19:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-125-89.rdu2.redhat.com [10.10.125.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C03D8443C; Wed, 4 Apr 2018 19:19:15 +0000 (UTC) From: jglisse@redhat.com To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Jens Axboe , Andrew Morton , Alexander Viro , Tejun Heo , Jan Kara , Josef Bacik , Mel Gorman Subject: [RFC PATCH 32/79] fs/block: do not rely on page->mapping get it from the context Date: Wed, 4 Apr 2018 15:18:06 -0400 Message-Id: <20180404191831.5378-17-jglisse@redhat.com> In-Reply-To: <20180404191831.5378-1-jglisse@redhat.com> References: <20180404191831.5378-1-jglisse@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 04 Apr 2018 19:19:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 04 Apr 2018 19:19:16 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jglisse@redhat.com' RCPT:'' Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jérôme Glisse This patch remove most dereference of page->mapping and get the mapping from the call context (either already available in the function or by adding it to function arguments). Signed-off-by: Jérôme Glisse Cc: Jens Axboe CC: Andrew Morton Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Cc: Tejun Heo Cc: Jan Kara Cc: Josef Bacik Cc: Mel Gorman --- fs/block_dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 502b6643bc74..dd9da97615e3 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -564,14 +564,14 @@ EXPORT_SYMBOL(thaw_bdev); static int blkdev_writepage(struct address_space *mapping, struct page *page, struct writeback_control *wbc) { - return block_write_full_page(page->mapping->host, page, + return block_write_full_page(mapping->host, page, blkdev_get_block, wbc); } static int blkdev_readpage(struct file * file, struct address_space *mapping, struct page * page) { - return block_read_full_page(page->mapping->host,page,blkdev_get_block); + return block_read_full_page(mapping->host,page,blkdev_get_block); } static int blkdev_readpages(struct file *file, struct address_space *mapping, @@ -1941,7 +1941,7 @@ EXPORT_SYMBOL_GPL(blkdev_read_iter); static int blkdev_releasepage(struct address_space *mapping, struct page *page, gfp_t wait) { - struct super_block *super = BDEV_I(page->mapping->host)->bdev.bd_super; + struct super_block *super = BDEV_I(mapping->host)->bdev.bd_super; if (super && super->s_op->bdev_try_to_free_page) return super->s_op->bdev_try_to_free_page(super, page, wait);