From patchwork Fri Jul 21 22:39:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 9857849 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 08F72600F5 for ; Fri, 21 Jul 2017 22:48:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEB3528668 for ; Fri, 21 Jul 2017 22:48:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2BBB28675; Fri, 21 Jul 2017 22:48:40 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A03E428668 for ; Fri, 21 Jul 2017 22:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zf8udE0FUsAOvVW7YwAiNYZo6eN/5MGoSi3lr/+2Z9o=; b=Q+VX3g0pbem5GzVLbWGaJPBKAn pEOU6Qu+GXgiVN9W71E9JIdxD+hTz1Cy8aya7ZPhPC8nAOnAAdOB/2C6a7bDk9uW7VAwWG3itSiXg HCa3sXUyta6wlhQq+5bYanbH9FGUmdbuyPcDjUi7AwilWmvzvgMcGC4QQlGWODEEFR+y+R5IsVciy Lt3h6LBr3B/Z4N8lFCWbZC+wXUsW0q6fKKRH1mw/SAZHyA2eRDhVhPZZarOyE/4o32dxRPl0dBbMo ChxmwTwspqvQLI7PoUAnlXjFrZ5angYBs6OTnd0N+2FdLoMMhRBjRHrF58Tan5k51Mf4lMTvuwt4D eMJAFZ9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dYgii-0008Ot-Nt; Fri, 21 Jul 2017 22:48:28 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dYgav-0004j9-0i for linux-arm-kernel@lists.infradead.org; Fri, 21 Jul 2017 22:40:26 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2017 15:40:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,392,1496127600"; d="scan'208";a="995742924" Received: from theros.lm.intel.com ([10.232.112.77]) by orsmga003.jf.intel.com with ESMTP; 21 Jul 2017 15:40:08 -0700 From: Ross Zwisler To: Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH v4 4/5] dax: remove DAX code from page_cache_tree_insert() Date: Fri, 21 Jul 2017 16:39:54 -0600 Message-Id: <20170721223956.29485-5-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170721223956.29485-1-ross.zwisler@linux.intel.com> References: <20170721223956.29485-1-ross.zwisler@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170721_154025_172501_A24AEE63 X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , linux-doc@vger.kernel.org, David Airlie , Dave Chinner , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Andreas Dilger , Patrik Jakobsson , Christoph Hellwig , linux-samsung-soc@vger.kernel.org, Joonyoung Shim , "Darrick J. Wong" , Tomi Valkeinen , Kyungmin Park , Krzysztof Kozlowski , Ingo Molnar , Ross Zwisler , linux-ext4@vger.kernel.org, Matthew Wilcox , linux-arm-msm@vger.kernel.org, Steven Rostedt , Inki Dae , linux-nvdimm@lists.01.org, Alexander Viro , Dan Williams , linux-arm-kernel@lists.infradead.org, Theodore Ts'o , Jonathan Corbet , Seung-Woo Kim , linux-xfs@vger.kernel.org, Rob Clark , Kukjin Kim , linux-fsdevel@vger.kernel.org, freedreno@lists.freedesktop.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we no longer insert struct page pointers in DAX radix trees we can remove the special casing for DAX in page_cache_tree_insert(). This also allows us to make dax_wake_mapping_entry_waiter() local to fs/dax.c, removing it from dax.h. Signed-off-by: Ross Zwisler Suggested-by: Jan Kara Reviewed-by: Jan Kara --- fs/dax.c | 2 +- include/linux/dax.h | 2 -- mm/filemap.c | 13 ++----------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index fb0e4c1..0e27d90 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -127,7 +127,7 @@ static int wake_exceptional_entry_func(wait_queue_entry_t *wait, unsigned int mo * correct waitqueue where tasks might be waiting for that old 'entry' and * wake them. */ -void dax_wake_mapping_entry_waiter(struct address_space *mapping, +static void dax_wake_mapping_entry_waiter(struct address_space *mapping, pgoff_t index, void *entry, bool wake_all) { struct exceptional_entry_key key; diff --git a/include/linux/dax.h b/include/linux/dax.h index 29cced8..afa99bb 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -122,8 +122,6 @@ int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index); int dax_invalidate_mapping_entry_sync(struct address_space *mapping, pgoff_t index); -void dax_wake_mapping_entry_waiter(struct address_space *mapping, - pgoff_t index, void *entry, bool wake_all); #ifdef CONFIG_FS_DAX int __dax_zero_page_range(struct block_device *bdev, diff --git a/mm/filemap.c b/mm/filemap.c index a497024..1bf1265 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -130,17 +130,8 @@ static int page_cache_tree_insert(struct address_space *mapping, return -EEXIST; mapping->nrexceptional--; - if (!dax_mapping(mapping)) { - if (shadowp) - *shadowp = p; - } else { - /* DAX can replace empty locked entry with a hole */ - WARN_ON_ONCE(p != - dax_radix_locked_entry(0, RADIX_DAX_EMPTY)); - /* Wakeup waiters for exceptional entry lock */ - dax_wake_mapping_entry_waiter(mapping, page->index, p, - true); - } + if (shadowp) + *shadowp = p; } __radix_tree_replace(&mapping->page_tree, node, slot, page, workingset_update_node, mapping);