Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp718896pxj; Thu, 3 Jun 2021 18:24:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9phNXgLypGGrWwvAacrYxD8/NVzUMUhSWdNbLXwRVQJPSdF5gHRhXb+F/dpt9kaEXcKAa X-Received: by 2002:a17:906:a890:: with SMTP id ha16mr1733510ejb.159.1622769852084; Thu, 03 Jun 2021 18:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622769852; cv=none; d=google.com; s=arc-20160816; b=LLaSRIDF0n0yLa8SCAF+pBWOF0v+RbUaDUR3BJpuDAK5YeIRY0y448CQvN1h0QyE4L 6nkSynoRb8tXLXexeip5xSvVoJ4vrtPr5Pg4+FFrLQZV3xhMRWBDjKg6NfIU/9PWbzga PhX62YQz0fvwt1Pb181zM3v2Sy5Vnh9XGRdoUXMiIi6yiUTZHxLVYWs1CE6Lk3vbJ6uM INPutzKYfxMqV1yXXlZSFaygnIrzWvvqwveMlxBnzokXzdCLUh+KPG8lPP+qOPonYamA qQ4TVx+OQLSHx3Nppyz5AAlcxyIjlnvkUe75nQvQOjNZJZyRrG5snhjBSFKXnM+ifU6H wqIg== 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 :ironport-hdrordr; bh=2sPy4jBs6FNlpL6UxlpR5nAZFm2x105PTgAUCHUGa8s=; b=RMCsUMxA7WHYbT26ELUusGIZQVue2pyEsrpYw/dflaejMTIIpHXvcLUNhJ7HNivTfb xex0nWBf166ipfvHASKhmrce7qL2zUIqpVISaL4A1HQJrHtvhc5u0qE/6DjrZDEsqVfW +TrLUhBc1Jjm69yGwvwAJK1mn+3Xfe4kAP78eSUdu2jo+EWLXZEs28rZjNjFcwnEo496 gOcGKqczO3KO6lIERY5Wt9QCmjF3nZh8IocEPcsOdavkIVWlzz6l+CAsf7QNXgTROYyH NxRh31AGjD/EobgNW8cVXZ99JxB8/Z2QQfEPy14z1DsKaOa9Cmz9WgdUDq21ltciOJdZ t2pA== 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 bz5si3387512ejc.12.2021.06.03.18.23.49; Thu, 03 Jun 2021 18:24:12 -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 S230191AbhFDBVo (ORCPT + 99 others); Thu, 3 Jun 2021 21:21:44 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:12868 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230158AbhFDBVn (ORCPT ); Thu, 3 Jun 2021 21:21:43 -0400 IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AcCF6eK06cXta36UsjGq5FgqjBI4kLtp133Aq?= =?us-ascii?q?2lEZdPU1SL39qynKppkmPHDP5gr5J0tLpTntAsi9qBDnhPtICOsqTNSftWDd0Q?= =?us-ascii?q?PGEGgI1/qB/9SPIU3D398Y/aJhXow7M9foEGV95PyQ3CCIV/om3/mLmZrFudvj?= X-IronPort-AV: E=Sophos;i="5.83,246,1616428800"; d="scan'208";a="109209850" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 04 Jun 2021 09:19:55 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id 8C6124C36A03; Fri, 4 Jun 2021 09:19:53 +0800 (CST) Received: from G08CNEXJMPEKD02.g08.fujitsu.local (10.167.33.202) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 4 Jun 2021 09:19:49 +0800 Received: from G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.80) by G08CNEXJMPEKD02.g08.fujitsu.local (10.167.33.202) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 4 Jun 2021 09:19:47 +0800 Received: from irides.mr.mr.mr (10.167.225.141) by G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 4 Jun 2021 09:19:47 +0800 From: Shiyang Ruan To: , , , , , CC: , , , , , , Subject: [PATCH v4 10/10] fs/dax: Remove useless functions Date: Fri, 4 Jun 2021 09:18:44 +0800 Message-ID: <20210604011844.1756145-11-ruansy.fnst@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210604011844.1756145-1-ruansy.fnst@fujitsu.com> References: <20210604011844.1756145-1-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-yoursite-MailScanner-ID: 8C6124C36A03.A0BA1 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@fujitsu.com X-Spam-Status: No Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since owner tracking is triggerred by pmem device, these functions are useless. So remove them. 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 1a7473f46df2..aff1e0f58967 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -334,48 +334,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; @@ -554,7 +512,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, WAKE_ALL); mapping->nrpages -= PG_PMD_NR; @@ -691,7 +648,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->nrpages -= 1UL << dax_entry_order(entry); ret = 1; @@ -785,8 +741,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.31.1