mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
mm: remove callers of pfn_t functionality
All PFN_* pfn_t flags have been removed. Therefore there is no longer a need for the pfn_t type and all uses can be replaced with normal pfns. Link: https://lkml.kernel.org/r/bbedfa576c9822f8032494efbe43544628698b1f.1750323463.git-series.apopple@nvidia.com Signed-off-by: Alistair Popple <apopple@nvidia.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: David Hildenbrand <david@redhat.com> Cc: Balbir Singh <balbirs@nvidia.com> Cc: Björn Töpel <bjorn@kernel.org> Cc: Björn Töpel <bjorn@rivosinc.com> Cc: Chunyan Zhang <zhang.lyra@gmail.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Deepak Gupta <debug@rivosinc.com> Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Cc: Inki Dae <m.szyprowski@samsung.com> Cc: John Groves <john@groves.net> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
984921edea
commit
21aa65bf82
@@ -4,7 +4,6 @@
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/pfn_t.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/dax.h>
|
||||
@@ -73,7 +72,7 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void dax_set_mapping(struct vm_fault *vmf, pfn_t pfn,
|
||||
static void dax_set_mapping(struct vm_fault *vmf, unsigned long pfn,
|
||||
unsigned long fault_size)
|
||||
{
|
||||
unsigned long i, nr_pages = fault_size / PAGE_SIZE;
|
||||
@@ -89,7 +88,7 @@ static void dax_set_mapping(struct vm_fault *vmf, pfn_t pfn,
|
||||
ALIGN_DOWN(vmf->address, fault_size));
|
||||
|
||||
for (i = 0; i < nr_pages; i++) {
|
||||
struct folio *folio = pfn_folio(pfn_t_to_pfn(pfn) + i);
|
||||
struct folio *folio = pfn_folio(pfn + i);
|
||||
|
||||
if (folio->mapping)
|
||||
continue;
|
||||
@@ -104,7 +103,7 @@ static vm_fault_t __dev_dax_pte_fault(struct dev_dax *dev_dax,
|
||||
{
|
||||
struct device *dev = &dev_dax->dev;
|
||||
phys_addr_t phys;
|
||||
pfn_t pfn;
|
||||
unsigned long pfn;
|
||||
unsigned int fault_size = PAGE_SIZE;
|
||||
|
||||
if (check_vma(dev_dax, vmf->vma, __func__))
|
||||
@@ -125,11 +124,11 @@ static vm_fault_t __dev_dax_pte_fault(struct dev_dax *dev_dax,
|
||||
return VM_FAULT_SIGBUS;
|
||||
}
|
||||
|
||||
pfn = phys_to_pfn_t(phys, 0);
|
||||
pfn = PHYS_PFN(phys);
|
||||
|
||||
dax_set_mapping(vmf, pfn, fault_size);
|
||||
|
||||
return vmf_insert_page_mkwrite(vmf, pfn_t_to_page(pfn),
|
||||
return vmf_insert_page_mkwrite(vmf, pfn_to_page(pfn),
|
||||
vmf->flags & FAULT_FLAG_WRITE);
|
||||
}
|
||||
|
||||
@@ -140,7 +139,7 @@ static vm_fault_t __dev_dax_pmd_fault(struct dev_dax *dev_dax,
|
||||
struct device *dev = &dev_dax->dev;
|
||||
phys_addr_t phys;
|
||||
pgoff_t pgoff;
|
||||
pfn_t pfn;
|
||||
unsigned long pfn;
|
||||
unsigned int fault_size = PMD_SIZE;
|
||||
|
||||
if (check_vma(dev_dax, vmf->vma, __func__))
|
||||
@@ -169,11 +168,11 @@ static vm_fault_t __dev_dax_pmd_fault(struct dev_dax *dev_dax,
|
||||
return VM_FAULT_SIGBUS;
|
||||
}
|
||||
|
||||
pfn = phys_to_pfn_t(phys, 0);
|
||||
pfn = PHYS_PFN(phys);
|
||||
|
||||
dax_set_mapping(vmf, pfn, fault_size);
|
||||
|
||||
return vmf_insert_folio_pmd(vmf, page_folio(pfn_t_to_page(pfn)),
|
||||
return vmf_insert_folio_pmd(vmf, page_folio(pfn_to_page(pfn)),
|
||||
vmf->flags & FAULT_FLAG_WRITE);
|
||||
}
|
||||
|
||||
@@ -185,7 +184,7 @@ static vm_fault_t __dev_dax_pud_fault(struct dev_dax *dev_dax,
|
||||
struct device *dev = &dev_dax->dev;
|
||||
phys_addr_t phys;
|
||||
pgoff_t pgoff;
|
||||
pfn_t pfn;
|
||||
unsigned long pfn;
|
||||
unsigned int fault_size = PUD_SIZE;
|
||||
|
||||
|
||||
@@ -215,11 +214,11 @@ static vm_fault_t __dev_dax_pud_fault(struct dev_dax *dev_dax,
|
||||
return VM_FAULT_SIGBUS;
|
||||
}
|
||||
|
||||
pfn = phys_to_pfn_t(phys, 0);
|
||||
pfn = PHYS_PFN(phys);
|
||||
|
||||
dax_set_mapping(vmf, pfn, fault_size);
|
||||
|
||||
return vmf_insert_folio_pud(vmf, page_folio(pfn_t_to_page(pfn)),
|
||||
return vmf_insert_folio_pud(vmf, page_folio(pfn_to_page(pfn)),
|
||||
vmf->flags & FAULT_FLAG_WRITE);
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/memregion.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pfn_t.h>
|
||||
#include <linux/dax.h>
|
||||
#include "../bus.h"
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <linux/memory.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/pfn_t.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/dax.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
/* Copyright(c) 2016 - 2018 Intel Corporation. All rights reserved. */
|
||||
#include <linux/memremap.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pfn_t.h>
|
||||
#include "../nvdimm/pfn.h"
|
||||
#include "../nvdimm/nd.h"
|
||||
#include "bus.h"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/mount.h>
|
||||
#include <linux/pseudo_fs.h>
|
||||
#include <linux/magic.h>
|
||||
#include <linux/pfn_t.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/uio.h>
|
||||
@@ -148,7 +147,7 @@ enum dax_device_flags {
|
||||
* pages accessible at the device relative @pgoff.
|
||||
*/
|
||||
long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
|
||||
enum dax_access_mode mode, void **kaddr, pfn_t *pfn)
|
||||
enum dax_access_mode mode, void **kaddr, unsigned long *pfn)
|
||||
{
|
||||
long avail;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user