Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3388835pxb; Mon, 25 Jan 2021 15:02:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+BO1JLnFx1p21Fk1eECOaHLTlK4p0X10Bj/Oq995x/V7Dxxkg4IpwKlhi/oPKL3X7mXJ0 X-Received: by 2002:a17:906:2a42:: with SMTP id k2mr1703785eje.118.1611615726245; Mon, 25 Jan 2021 15:02:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611615726; cv=none; d=google.com; s=arc-20160816; b=1AyIOK5HoIybbe9FZODb7ifyoZChVJdV1L0Mp44xlWo0cdBz3Ji2iXgNUTI1+qA/ie JcLVyG/MAnSuar/3r64SQkg0911gIyZBHkGnjCoqXV7odNw2tfUVAwHgfa939r+u9h0d 7N1jzy6lyw8vJw1T5zKNAIwNTPEzYa6wjH1hGCVRqyQm7yzYUfo1phwVSiD2EB1Njdpu ojsyGtqII25z79XM6IEHDlze2p3T/s4E0SHO39tBMIJaaOnHK8obpplsk9GszX2HJJRQ 7TCNYVFt/UIDwJEhRB0znNU600zKDhAc55xCnn7Qnj6iXwZLkuujYxlUbNGqYyBSaEHl hqmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pOlpgpN8ylKR8r4T15DwLEjuo6X9mqaE0evoKnTRt9g=; b=emyYXwyjX/k7V2oRH+svq8t++H1G5NuvmJ8IhlHbU0EWq8wJyifbADq/Ck1sa2zSfo m44deQXYOW0BmM5TANhse1mQcUk24fluavjJoyWacZDLvWKAXimrkSE4WjPmhS6XSdoH DsHhxmLzgzeGgwQwKEXQluq210UyAKGQR/XR8m/iP7R1iFmRV5CG/QuY1866j2GhpAZl ojREQ4N8pnnD9x+OFHAF2xuFoukrsxcROWKcn9pcc7NAmEssCGzWgvrfEUXDDEDCzUwV wIvaYzVYzuacVDZA2rtTFNNpq/U0X8MOrwazyU7b8LpI5csDoFTULO4FELE0mezQZWhA 6GRg== 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 dm28si7634630edb.528.2021.01.25.15.01.42; Mon, 25 Jan 2021 15:02:06 -0800 (PST) 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 S1727046AbhAYXAd (ORCPT + 99 others); Mon, 25 Jan 2021 18:00:33 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:41443 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732103AbhAYW5x (ORCPT ); Mon, 25 Jan 2021 17:57:53 -0500 X-IronPort-AV: E=Sophos;i="5.79,374,1602518400"; d="scan'208";a="103820587" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 26 Jan 2021 06:55:45 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id 143E24CE6014; Tue, 26 Jan 2021 06:55:42 +0800 (CST) Received: from G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.200) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 26 Jan 2021 06:55:41 +0800 Received: from irides.mr.mr.mr (10.167.225.141) by G08CNEXCHPEKD04.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 26 Jan 2021 06:55:40 +0800 From: Shiyang Ruan To: , , , CC: , , , , , , , , , Subject: [PATCH v2 10/10] fs/dax: Remove useless functions Date: Tue, 26 Jan 2021 06:55:26 +0800 Message-ID: <20210125225526.1048877-11-ruansy.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210125225526.1048877-1-ruansy.fnst@cn.fujitsu.com> References: <20210125225526.1048877-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: 143E24CE6014.ACA70 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@cn.fujitsu.com X-Spam-Status: No 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 c64c3a0e76a6..e20a5df03eec 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; @@ -543,7 +501,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--; @@ -680,7 +637,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; @@ -774,8 +730,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.30.0