From patchwork Wed Apr 4 19:17:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 10323253 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 25A0160390 for ; Wed, 4 Apr 2018 19:29:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1552127CEE for ; Wed, 4 Apr 2018 19:29:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09AAE28F56; Wed, 4 Apr 2018 19:29:24 +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=ham 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 95D2827CEE for ; Wed, 4 Apr 2018 19:29:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbeDDT3W (ORCPT ); Wed, 4 Apr 2018 15:29:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35208 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751696AbeDDTTH (ORCPT ); Wed, 4 Apr 2018 15:19:07 -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 61134EC00D; Wed, 4 Apr 2018 19:19:06 +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 A6F3494580; Wed, 4 Apr 2018 19:19:05 +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?= , Alexander Viro , Tejun Heo , Jan Kara , Josef Bacik , Mel Gorman , Jeff Layton Subject: [RFC PATCH 24/79] fs: add struct inode to nobh_writepage() arguments Date: Wed, 4 Apr 2018 15:17:59 -0400 Message-Id: <20180404191831.5378-10-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.1]); Wed, 04 Apr 2018 19:19:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 04 Apr 2018 19:19:06 +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 Add struct inode to nobh_writepage(). Note this patch only add arguments and modify call site conservatily using page->mapping and thus the end result is as before this patch. One step toward dropping reliance on page->mapping. Signed-off-by: Jérôme Glisse Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Cc: Tejun Heo Cc: Jan Kara Cc: Josef Bacik Cc: Mel Gorman Cc: Jeff Layton --- fs/buffer.c | 5 ++--- fs/ext2/inode.c | 2 +- fs/gfs2/aops.c | 3 ++- include/linux/buffer_head.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index aa7d9be68581..31298f4f0300 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2730,10 +2730,9 @@ EXPORT_SYMBOL(nobh_write_end); * that it tries to operate without attaching bufferheads to * the page. */ -int nobh_writepage(struct page *page, get_block_t *get_block, - struct writeback_control *wbc) +int nobh_writepage(struct inode *inode, struct page *page, + get_block_t *get_block, struct writeback_control *wbc) { - struct inode * const inode = page->mapping->host; loff_t i_size = i_size_read(inode); const pgoff_t end_index = i_size >> PAGE_SHIFT; unsigned offset; diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 37439d1e544c..11b3c3e7ea65 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -926,7 +926,7 @@ static int ext2_nobh_writepage(struct address_space *mapping, struct page *page, struct writeback_control *wbc) { - return nobh_writepage(page, ext2_get_block, wbc); + return nobh_writepage(page->mapping->host, page, ext2_get_block, wbc); } static sector_t ext2_bmap(struct address_space *mapping, sector_t block) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 8cfd4c7d884c..ff02313b86e6 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -142,7 +142,8 @@ static int gfs2_writepage(struct address_space *mapping, struct page *page, if (ret <= 0) return ret; - return nobh_writepage(page, gfs2_get_block_noalloc, wbc); + return nobh_writepage(page->mapping->host, page, + gfs2_get_block_noalloc, wbc); } /* This is the same as calling block_write_full_page, but it also diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index cab143668834..fb68a3358330 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -265,8 +265,8 @@ int nobh_write_end(struct file *, struct address_space *, loff_t, unsigned, unsigned, struct page *, void *); int nobh_truncate_page(struct address_space *, loff_t, get_block_t *); -int nobh_writepage(struct page *page, get_block_t *get_block, - struct writeback_control *wbc); +int nobh_writepage(struct inode *inode, struct page *page, + get_block_t *get_block, struct writeback_control *wbc); void buffer_init(void);