Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2819816pxk; Tue, 15 Sep 2020 03:15:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnumvjyPwZhWFbzkY//rZo6SWH+EDxxGByNOj+mWQJPyOMGqhsZF2ymkKgL88lKFe6uleC X-Received: by 2002:a17:907:7215:: with SMTP id dr21mr6970514ejc.239.1600164925239; Tue, 15 Sep 2020 03:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600164925; cv=none; d=google.com; s=arc-20160816; b=M5QXdt1Vc1aRB669MjhwAbcTuAGRLOqoBrCz7LWFKDfOLB+M+cvGsmqK/W1EkGXIW7 PnnZg5UsWoVn8ndJ6Iocq+jO9VLF3Zp8NjkYt7PKo+FHje7DibVf29hduwgdLeAfnAd/ hfh1e4T8LOTMpCwXAUJLkJQ+JFOw6vqs7z2VG1fOFzyu7hZJ7cM+UThtHPoH7Dsx9Zl5 X8zUChOm7nqcsQtlDdoyxwgpLcxNPUtUv67d49TS8bmVCznqm1jMmc0lo8voGC0GFDN8 Wq+UKSLzoVpqHat2KIAtqWL3vB1uEeimrXtwsYaxSUjShqIbqUs2VR1d94INBOCkg9q8 ry0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xzRbQIjHiaacoHnO3iCwYGbktm/OTlXqkTSWfPoxars=; b=MAmKEIO12gCF8w5c12lJ4sWmCqCF2ubeeckiUmrzaSpc/l30aAt8Ce3MxBZtBt/LcW 4vJ4QGsWnsM2ko7rinLTxcoS3Pl4FyzmEQ0DpJLawMa4lF08aylGs2tDlHzq/OAw87NI yXIvyGyn9JWMzaKdOQRpuvL6OxmUbfZ4WfXr58v1rk1VpfaQjAo/QDquMwoeJ6kx0cna 96gKaC8tUQOWIpU0HMrCJWk7Zy/q4qsRwRx74W1ceZOuPh+prmgzOkg0ePzMnZb+r7Tn aYDXCIHSocmLM6nul+acvBI/mcI9xrgNcSEp5S73xo1pZFqypGTSNu2AtGyOPxdFfY/Z kEHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si9519445edv.47.2020.09.15.03.15.03; Tue, 15 Sep 2020 03:15:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbgIOKNx (ORCPT + 99 others); Tue, 15 Sep 2020 06:13:53 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:44316 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726380AbgIOKNd (ORCPT ); Tue, 15 Sep 2020 06:13:33 -0400 X-IronPort-AV: E=Sophos;i="5.76,429,1592841600"; d="scan'208";a="99252011" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 15 Sep 2020 18:13:25 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id 832C448990DF; Tue, 15 Sep 2020 18:13:21 +0800 (CST) Received: from G08CNEXJMPEKD02.g08.fujitsu.local (10.167.33.202) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Sep 2020 18:13:20 +0800 Received: from G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.203) by G08CNEXJMPEKD02.g08.fujitsu.local (10.167.33.202) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Sep 2020 18:13:19 +0800 Received: from localhost.localdomain (10.167.225.141) by G08CNEXCHPEKD05.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 15 Sep 2020 18:13:18 +0800 From: Shiyang Ruan To: , , , CC: , , , , , , , Subject: [RFC PATCH 4/4] fsdax: remove useless (dis)associate functions Date: Tue, 15 Sep 2020 18:13:11 +0800 Message-ID: <20200915101311.144269-5-ruansy.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915101311.144269-1-ruansy.fnst@cn.fujitsu.com> References: <20200915101311.144269-1-ruansy.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-yoursite-MailScanner-ID: 832C448990DF.A9901 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since owner tarcking is triggerred by pmem device, these functions are useless. So remove it. Signed-off-by: Shiyang Ruan --- fs/dax.c | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 1ec592f0aadd..4c85b07abcc0 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -323,48 +323,6 @@ static unsigned long dax_end_pfn(void *entry) for (pfn = dax_to_pfn(entry); \ pfn < dax_end_pfn(entry); pfn++) -/* - * TODO: for reflink+dax we need a way to associate a single page with - * multiple address_space instances at different linear_page_index() - * offsets. - */ -static void dax_associate_entry(void *entry, struct address_space *mapping, - struct vm_area_struct *vma, unsigned long address) -{ - unsigned long size = dax_entry_size(entry), pfn, index; - int i = 0; - - if (IS_ENABLED(CONFIG_FS_DAX_LIMITED)) - return; - - index = linear_page_index(vma, address & ~(size - 1)); - for_each_mapped_pfn(entry, pfn) { - struct page *page = pfn_to_page(pfn); - - WARN_ON_ONCE(page->mapping); - page->mapping = mapping; - page->index = index + i++; - } -} - -static void dax_disassociate_entry(void *entry, struct address_space *mapping, - bool trunc) -{ - unsigned long pfn; - - if (IS_ENABLED(CONFIG_FS_DAX_LIMITED)) - return; - - for_each_mapped_pfn(entry, pfn) { - struct page *page = pfn_to_page(pfn); - - WARN_ON_ONCE(trunc && page_ref_count(page) > 1); - WARN_ON_ONCE(page->mapping && page->mapping != mapping); - page->mapping = NULL; - page->index = 0; - } -} - static struct page *dax_busy_page(void *entry) { unsigned long pfn; @@ -516,7 +474,6 @@ static void *grab_mapping_entry(struct xa_state *xas, xas_lock_irq(xas); } - dax_disassociate_entry(entry, mapping, false); xas_store(xas, NULL); /* undo the PMD join */ dax_wake_entry(xas, entry, true); mapping->nrexceptional--; @@ -636,7 +593,6 @@ static int __dax_invalidate_entry(struct address_space *mapping, (xas_get_mark(&xas, PAGECACHE_TAG_DIRTY) || xas_get_mark(&xas, PAGECACHE_TAG_TOWRITE))) goto out; - dax_disassociate_entry(entry, mapping, trunc); xas_store(&xas, NULL); mapping->nrexceptional--; ret = 1; @@ -730,8 +686,6 @@ static void *dax_insert_entry(struct xa_state *xas, if (dax_is_zero_entry(entry) || dax_is_empty_entry(entry)) { void *old; - dax_disassociate_entry(entry, mapping, false); - dax_associate_entry(new_entry, mapping, vmf->vma, vmf->address); /* * Only swap our new entry into the page cache if the current * entry is a zero page or an empty entry. If a normal PTE or -- 2.28.0