From patchwork Wed Apr 4 19:18:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 10323229 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 9E0EE60467 for ; Wed, 4 Apr 2018 19:28:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D4D526E90 for ; Wed, 4 Apr 2018 19:28:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 815AB28174; Wed, 4 Apr 2018 19:28:32 +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 30A1A26E90 for ; Wed, 4 Apr 2018 19:28:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752234AbeDDT2S (ORCPT ); Wed, 4 Apr 2018 15:28:18 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42162 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751852AbeDDTTQ (ORCPT ); Wed, 4 Apr 2018 15:19:16 -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 6670A722F0; Wed, 4 Apr 2018 19:19:15 +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 A093194583; Wed, 4 Apr 2018 19:19:14 +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 31/79] fs/block: add struct address_space to __block_write_begin_int() args Date: Wed, 4 Apr 2018 15:18:05 -0400 Message-Id: <20180404191831.5378-16-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.2]); Wed, 04 Apr 2018 19:19:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 04 Apr 2018 19:19:15 +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 address_space to __block_write_begin_int() arguments. One step toward dropping reliance on page->mapping. ---------------------------------------------------------------------- @exists@ identifier M; expression E1, E2, E3, E4, E5; @@ struct address_space *M; ... -__block_write_begin_int(E1, E2, E3, E4, E5) +__block_write_begin_int(M, E1, E2, E3, E4, E5) @exists@ identifier M, F; expression E1, E2, E3, E4, E5; @@ F(..., struct address_space *M, ...) {... -__block_write_begin_int(E1, E2, E3, E4, E5) +__block_write_begin_int(M, E1, E2, E3, E4, E5) ...} ---------------------------------------------------------------------- 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/buffer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index de16588d7f7f..c83878d0a4c0 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1943,8 +1943,9 @@ iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh, } } -int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, - get_block_t *get_block, struct iomap *iomap) +int __block_write_begin_int(struct address_space *mapping, struct page *page, + loff_t pos, unsigned len, get_block_t *get_block, + struct iomap *iomap) { unsigned from = pos & (PAGE_SIZE - 1); unsigned to = from + len; @@ -2031,7 +2032,8 @@ int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, int __block_write_begin(struct address_space *mapping, struct page *page, loff_t pos, unsigned len, get_block_t *get_block) { - return __block_write_begin_int(page, pos, len, get_block, NULL); + return __block_write_begin_int(mapping, page, pos, len, get_block, + NULL); } EXPORT_SYMBOL(__block_write_begin);