License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2016-01-16 00:56:19 +00:00
|
|
|
#ifndef _LINUX_MEMREMAP_H_
|
|
|
|
#define _LINUX_MEMREMAP_H_
|
2020-10-13 23:50:29 +00:00
|
|
|
#include <linux/range.h>
|
2016-01-16 00:56:49 +00:00
|
|
|
#include <linux/ioport.h>
|
|
|
|
#include <linux/percpu-refcount.h>
|
2016-01-16 00:56:19 +00:00
|
|
|
|
|
|
|
struct resource;
|
|
|
|
struct device;
|
2016-01-16 00:56:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* struct vmem_altmap - pre-allocated storage for vmemmap_populate
|
|
|
|
* @base_pfn: base of the entire dev_pagemap mapping
|
|
|
|
* @reserve: pages mapped, but reserved for driver use (relative to @base)
|
|
|
|
* @free: free pages set aside in the mapping for memmap storage
|
|
|
|
* @align: pages reserved to meet allocation alignments
|
|
|
|
* @alloc: track pages consumed, private to vmemmap_populate()
|
|
|
|
*/
|
|
|
|
struct vmem_altmap {
|
|
|
|
const unsigned long base_pfn;
|
2019-09-10 06:28:25 +00:00
|
|
|
const unsigned long end_pfn;
|
2016-01-16 00:56:22 +00:00
|
|
|
const unsigned long reserve;
|
|
|
|
unsigned long free;
|
|
|
|
unsigned long align;
|
|
|
|
unsigned long alloc;
|
|
|
|
};
|
|
|
|
|
2017-09-08 23:11:43 +00:00
|
|
|
/*
|
|
|
|
* Specialize ZONE_DEVICE memory into multiple types each having differents
|
|
|
|
* usage.
|
|
|
|
*
|
|
|
|
* MEMORY_DEVICE_PRIVATE:
|
|
|
|
* Device memory that is not directly addressable by the CPU: CPU can neither
|
|
|
|
* read nor write private memory. In this case, we do still have struct pages
|
|
|
|
* backing the device memory. Doing so simplifies the implementation, but it is
|
|
|
|
* important to remember that there are certain points at which the struct page
|
|
|
|
* must be treated as an opaque object, rather than a "normal" struct page.
|
|
|
|
*
|
|
|
|
* A more complete discussion of unaddressable memory may be found in
|
2018-03-21 19:22:47 +00:00
|
|
|
* include/linux/hmm.h and Documentation/vm/hmm.rst.
|
2017-09-08 23:12:24 +00:00
|
|
|
*
|
2018-05-16 18:46:08 +00:00
|
|
|
* MEMORY_DEVICE_FS_DAX:
|
|
|
|
* Host memory that has similar access semantics as System RAM i.e. DMA
|
|
|
|
* coherent and supports page pinning. In support of coordinating page
|
|
|
|
* pinning vs other operations MEMORY_DEVICE_FS_DAX arranges for a
|
|
|
|
* wakeup event whenever a page is unpinned and becomes idle. This
|
|
|
|
* wakeup is used to coordinate physical address space management (ex:
|
|
|
|
* fs truncate/hole punch) vs pinned pages (ex: device dma).
|
PCI/P2PDMA: Support peer-to-peer memory
Some PCI devices may have memory mapped in a BAR space that's intended for
use in peer-to-peer transactions. To enable such transactions the memory
must be registered with ZONE_DEVICE pages so it can be used by DMA
interfaces in existing drivers.
Add an interface for other subsystems to find and allocate chunks of P2P
memory as necessary to facilitate transfers between two PCI peers:
struct pci_dev *pci_p2pmem_find[_many]();
int pci_p2pdma_distance[_many]();
void *pci_alloc_p2pmem();
The new interface requires a driver to collect a list of client devices
involved in the transaction then call pci_p2pmem_find() to obtain any
suitable P2P memory. Alternatively, if the caller knows a device which
provides P2P memory, they can use pci_p2pdma_distance() to determine if it
is usable. With a suitable p2pmem device, memory can then be allocated
with pci_alloc_p2pmem() for use in DMA transactions.
Depending on hardware, using peer-to-peer memory may reduce the bandwidth
of the transfer but can significantly reduce pressure on system memory.
This may be desirable in many cases: for example a system could be designed
with a small CPU connected to a PCIe switch by a small number of lanes
which would maximize the number of lanes available to connect to NVMe
devices.
The code is designed to only utilize the p2pmem device if all the devices
involved in a transfer are behind the same PCI bridge. This is because we
have no way of knowing whether peer-to-peer routing between PCIe Root Ports
is supported (PCIe r4.0, sec 1.3.1). Additionally, the benefits of P2P
transfers that go through the RC is limited to only reducing DRAM usage
and, in some cases, coding convenience. The PCI-SIG may be exploring
adding a new capability bit to advertise whether this is possible for
future hardware.
This commit includes significant rework and feedback from Christoph
Hellwig.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
[bhelgaas: fold in fix from Keith Busch <keith.busch@intel.com>:
https://lore.kernel.org/linux-pci/20181012155920.15418-1-keith.busch@intel.com,
to address comment from Dan Carpenter <dan.carpenter@oracle.com>, fold in
https://lore.kernel.org/linux-pci/20181017160510.17926-1-logang@deltatee.com]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2018-10-04 21:27:35 +00:00
|
|
|
*
|
2020-09-01 08:33:25 +00:00
|
|
|
* MEMORY_DEVICE_GENERIC:
|
2019-06-26 12:27:07 +00:00
|
|
|
* Host memory that has similar access semantics as System RAM i.e. DMA
|
2020-09-01 08:33:25 +00:00
|
|
|
* coherent and supports page pinning. This is for example used by DAX devices
|
|
|
|
* that expose memory using a character device.
|
2019-06-26 12:27:07 +00:00
|
|
|
*
|
PCI/P2PDMA: Support peer-to-peer memory
Some PCI devices may have memory mapped in a BAR space that's intended for
use in peer-to-peer transactions. To enable such transactions the memory
must be registered with ZONE_DEVICE pages so it can be used by DMA
interfaces in existing drivers.
Add an interface for other subsystems to find and allocate chunks of P2P
memory as necessary to facilitate transfers between two PCI peers:
struct pci_dev *pci_p2pmem_find[_many]();
int pci_p2pdma_distance[_many]();
void *pci_alloc_p2pmem();
The new interface requires a driver to collect a list of client devices
involved in the transaction then call pci_p2pmem_find() to obtain any
suitable P2P memory. Alternatively, if the caller knows a device which
provides P2P memory, they can use pci_p2pdma_distance() to determine if it
is usable. With a suitable p2pmem device, memory can then be allocated
with pci_alloc_p2pmem() for use in DMA transactions.
Depending on hardware, using peer-to-peer memory may reduce the bandwidth
of the transfer but can significantly reduce pressure on system memory.
This may be desirable in many cases: for example a system could be designed
with a small CPU connected to a PCIe switch by a small number of lanes
which would maximize the number of lanes available to connect to NVMe
devices.
The code is designed to only utilize the p2pmem device if all the devices
involved in a transfer are behind the same PCI bridge. This is because we
have no way of knowing whether peer-to-peer routing between PCIe Root Ports
is supported (PCIe r4.0, sec 1.3.1). Additionally, the benefits of P2P
transfers that go through the RC is limited to only reducing DRAM usage
and, in some cases, coding convenience. The PCI-SIG may be exploring
adding a new capability bit to advertise whether this is possible for
future hardware.
This commit includes significant rework and feedback from Christoph
Hellwig.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
[bhelgaas: fold in fix from Keith Busch <keith.busch@intel.com>:
https://lore.kernel.org/linux-pci/20181012155920.15418-1-keith.busch@intel.com,
to address comment from Dan Carpenter <dan.carpenter@oracle.com>, fold in
https://lore.kernel.org/linux-pci/20181017160510.17926-1-logang@deltatee.com]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2018-10-04 21:27:35 +00:00
|
|
|
* MEMORY_DEVICE_PCI_P2PDMA:
|
|
|
|
* Device memory residing in a PCI BAR intended for use with Peer-to-Peer
|
|
|
|
* transactions.
|
2017-09-08 23:11:43 +00:00
|
|
|
*/
|
|
|
|
enum memory_type {
|
2019-06-26 12:27:07 +00:00
|
|
|
/* 0 is reserved to catch uninitialized type fields */
|
2018-05-16 18:46:08 +00:00
|
|
|
MEMORY_DEVICE_PRIVATE = 1,
|
|
|
|
MEMORY_DEVICE_FS_DAX,
|
2020-09-01 08:33:25 +00:00
|
|
|
MEMORY_DEVICE_GENERIC,
|
PCI/P2PDMA: Support peer-to-peer memory
Some PCI devices may have memory mapped in a BAR space that's intended for
use in peer-to-peer transactions. To enable such transactions the memory
must be registered with ZONE_DEVICE pages so it can be used by DMA
interfaces in existing drivers.
Add an interface for other subsystems to find and allocate chunks of P2P
memory as necessary to facilitate transfers between two PCI peers:
struct pci_dev *pci_p2pmem_find[_many]();
int pci_p2pdma_distance[_many]();
void *pci_alloc_p2pmem();
The new interface requires a driver to collect a list of client devices
involved in the transaction then call pci_p2pmem_find() to obtain any
suitable P2P memory. Alternatively, if the caller knows a device which
provides P2P memory, they can use pci_p2pdma_distance() to determine if it
is usable. With a suitable p2pmem device, memory can then be allocated
with pci_alloc_p2pmem() for use in DMA transactions.
Depending on hardware, using peer-to-peer memory may reduce the bandwidth
of the transfer but can significantly reduce pressure on system memory.
This may be desirable in many cases: for example a system could be designed
with a small CPU connected to a PCIe switch by a small number of lanes
which would maximize the number of lanes available to connect to NVMe
devices.
The code is designed to only utilize the p2pmem device if all the devices
involved in a transfer are behind the same PCI bridge. This is because we
have no way of knowing whether peer-to-peer routing between PCIe Root Ports
is supported (PCIe r4.0, sec 1.3.1). Additionally, the benefits of P2P
transfers that go through the RC is limited to only reducing DRAM usage
and, in some cases, coding convenience. The PCI-SIG may be exploring
adding a new capability bit to advertise whether this is possible for
future hardware.
This commit includes significant rework and feedback from Christoph
Hellwig.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
[bhelgaas: fold in fix from Keith Busch <keith.busch@intel.com>:
https://lore.kernel.org/linux-pci/20181012155920.15418-1-keith.busch@intel.com,
to address comment from Dan Carpenter <dan.carpenter@oracle.com>, fold in
https://lore.kernel.org/linux-pci/20181017160510.17926-1-logang@deltatee.com]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2018-10-04 21:27:35 +00:00
|
|
|
MEMORY_DEVICE_PCI_P2PDMA,
|
2017-09-08 23:11:43 +00:00
|
|
|
};
|
|
|
|
|
2019-06-26 12:27:08 +00:00
|
|
|
struct dev_pagemap_ops {
|
|
|
|
/*
|
|
|
|
* Called once the page refcount reaches 1. (ZONE_DEVICE pages never
|
|
|
|
* reach 0 refcount unless there is a refcount bug. This allows the
|
|
|
|
* device driver to implement its own memory management.)
|
|
|
|
*/
|
2019-06-26 12:27:12 +00:00
|
|
|
void (*page_free)(struct page *page);
|
2019-06-26 12:27:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Transition the refcount in struct dev_pagemap to the dead state.
|
|
|
|
*/
|
2019-06-26 12:27:09 +00:00
|
|
|
void (*kill)(struct dev_pagemap *pgmap);
|
2019-06-26 12:27:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Wait for refcount in struct dev_pagemap to be idle and reap it.
|
|
|
|
*/
|
2019-06-26 12:27:09 +00:00
|
|
|
void (*cleanup)(struct dev_pagemap *pgmap);
|
2019-06-26 12:27:11 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Used for private (un-addressable) device memory only. Must migrate
|
|
|
|
* the page back to a CPU accessible page.
|
|
|
|
*/
|
|
|
|
vm_fault_t (*migrate_to_ram)(struct vm_fault *vmf);
|
2019-06-26 12:27:08 +00:00
|
|
|
};
|
2017-09-08 23:11:43 +00:00
|
|
|
|
2019-06-26 12:27:13 +00:00
|
|
|
#define PGMAP_ALTMAP_VALID (1 << 0)
|
|
|
|
|
2016-01-16 00:56:19 +00:00
|
|
|
/**
|
|
|
|
* struct dev_pagemap - metadata for ZONE_DEVICE mappings
|
2016-01-16 00:56:22 +00:00
|
|
|
* @altmap: pre-allocated/reserved memory for vmemmap allocations
|
2016-01-16 00:56:49 +00:00
|
|
|
* @ref: reference count that pins the devm_memremap_pages() mapping
|
2019-06-26 12:27:14 +00:00
|
|
|
* @internal_ref: internal reference if @ref is not provided by the caller
|
|
|
|
* @done: completion for @internal_ref
|
2017-09-08 23:11:43 +00:00
|
|
|
* @type: memory type: see MEMORY_* in memory_hotplug.h
|
2019-06-26 12:27:13 +00:00
|
|
|
* @flags: PGMAP_* flags to specify defailed behavior
|
2019-06-26 12:27:08 +00:00
|
|
|
* @ops: method table
|
2020-03-16 19:32:13 +00:00
|
|
|
* @owner: an opaque pointer identifying the entity that manages this
|
|
|
|
* instance. Used by various helpers to make sure that no
|
|
|
|
* foreign ZONE_DEVICE memory is accessed.
|
2020-10-13 23:50:34 +00:00
|
|
|
* @nr_range: number of ranges to be mapped
|
|
|
|
* @range: range to be mapped when nr_range == 1
|
|
|
|
* @ranges: array of ranges to be mapped when nr_range > 1
|
2016-01-16 00:56:19 +00:00
|
|
|
*/
|
|
|
|
struct dev_pagemap {
|
2017-12-29 07:54:04 +00:00
|
|
|
struct vmem_altmap altmap;
|
2016-01-16 00:56:49 +00:00
|
|
|
struct percpu_ref *ref;
|
2019-06-26 12:27:14 +00:00
|
|
|
struct percpu_ref internal_ref;
|
|
|
|
struct completion done;
|
2017-09-08 23:11:43 +00:00
|
|
|
enum memory_type type;
|
2019-06-26 12:27:13 +00:00
|
|
|
unsigned int flags;
|
2019-06-26 12:27:08 +00:00
|
|
|
const struct dev_pagemap_ops *ops;
|
2020-03-16 19:32:13 +00:00
|
|
|
void *owner;
|
2020-10-13 23:50:34 +00:00
|
|
|
int nr_range;
|
|
|
|
union {
|
|
|
|
struct range range;
|
|
|
|
struct range ranges[0];
|
|
|
|
};
|
2016-01-16 00:56:19 +00:00
|
|
|
};
|
|
|
|
|
2019-06-26 12:27:13 +00:00
|
|
|
static inline struct vmem_altmap *pgmap_altmap(struct dev_pagemap *pgmap)
|
|
|
|
{
|
|
|
|
if (pgmap->flags & PGMAP_ALTMAP_VALID)
|
|
|
|
return &pgmap->altmap;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-01-16 00:56:19 +00:00
|
|
|
#ifdef CONFIG_ZONE_DEVICE
|
2019-08-18 09:05:57 +00:00
|
|
|
void *memremap_pages(struct dev_pagemap *pgmap, int nid);
|
|
|
|
void memunmap_pages(struct dev_pagemap *pgmap);
|
2017-12-29 07:54:05 +00:00
|
|
|
void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
|
2019-06-13 22:56:21 +00:00
|
|
|
void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap);
|
2017-12-29 07:54:00 +00:00
|
|
|
struct dev_pagemap *get_dev_pagemap(unsigned long pfn,
|
|
|
|
struct dev_pagemap *pgmap);
|
2017-09-08 23:11:46 +00:00
|
|
|
|
2017-12-29 07:53:50 +00:00
|
|
|
unsigned long vmem_altmap_offset(struct vmem_altmap *altmap);
|
|
|
|
void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns);
|
2020-01-30 20:06:07 +00:00
|
|
|
unsigned long memremap_compat_align(void);
|
2016-01-16 00:56:19 +00:00
|
|
|
#else
|
|
|
|
static inline void *devm_memremap_pages(struct device *dev,
|
2017-12-29 07:54:05 +00:00
|
|
|
struct dev_pagemap *pgmap)
|
2016-01-16 00:56:19 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Fail attempts to call devm_memremap_pages() without
|
|
|
|
* ZONE_DEVICE support enabled, this requires callers to fall
|
|
|
|
* back to plain devm_memremap() based on config
|
|
|
|
*/
|
|
|
|
WARN_ON_ONCE(1);
|
|
|
|
return ERR_PTR(-ENXIO);
|
|
|
|
}
|
|
|
|
|
2019-06-13 22:56:21 +00:00
|
|
|
static inline void devm_memunmap_pages(struct device *dev,
|
|
|
|
struct dev_pagemap *pgmap)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-12-29 07:54:00 +00:00
|
|
|
static inline struct dev_pagemap *get_dev_pagemap(unsigned long pfn,
|
|
|
|
struct dev_pagemap *pgmap)
|
2016-01-16 00:56:19 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2017-12-29 07:53:50 +00:00
|
|
|
|
|
|
|
static inline unsigned long vmem_altmap_offset(struct vmem_altmap *altmap)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void vmem_altmap_free(struct vmem_altmap *altmap,
|
|
|
|
unsigned long nr_pfns)
|
|
|
|
{
|
|
|
|
}
|
2020-01-30 20:06:07 +00:00
|
|
|
|
|
|
|
/* when memremap_pages() is disabled all archs can remap a single page */
|
|
|
|
static inline unsigned long memremap_compat_align(void)
|
|
|
|
{
|
|
|
|
return PAGE_SIZE;
|
|
|
|
}
|
2017-12-29 07:53:50 +00:00
|
|
|
#endif /* CONFIG_ZONE_DEVICE */
|
2017-09-08 23:11:46 +00:00
|
|
|
|
2016-01-16 00:56:49 +00:00
|
|
|
static inline void put_dev_pagemap(struct dev_pagemap *pgmap)
|
|
|
|
{
|
|
|
|
if (pgmap)
|
|
|
|
percpu_ref_put(pgmap->ref);
|
|
|
|
}
|
2020-01-30 20:06:07 +00:00
|
|
|
|
2016-01-16 00:56:19 +00:00
|
|
|
#endif /* _LINUX_MEMREMAP_H_ */
|