aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memremap.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-12-29 02:53:50 -0500
committerDan Williams <dan.j.williams@intel.com>2018-01-08 14:43:03 -0500
commit8e37d00a850160bbfadbb3bf4ce49539770c5d2c (patch)
tree8eae54cbe4129e69d2c91a954624258ea1748a7d /include/linux/memremap.h
parent30a7acd573899fd8b8ac39236eff6468b195ac7d (diff)
memremap: provide stubs for vmem_altmap_offset and vmem_altmap_free
Currently all calls to those functions are eliminated by the compiler when CONFIG_ZONE_DEVICE is not set, but this soon won't be the case. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/memremap.h')
-rw-r--r--include/linux/memremap.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index 10d23c367048..d5a6736d9737 100644
--- a/include/linux/memremap.h
+++ b/include/linux/memremap.h
@@ -26,9 +26,6 @@ struct vmem_altmap {
26 unsigned long alloc; 26 unsigned long alloc;
27}; 27};
28 28
29unsigned long vmem_altmap_offset(struct vmem_altmap *altmap);
30void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns);
31
32#ifdef CONFIG_ZONE_DEVICE 29#ifdef CONFIG_ZONE_DEVICE
33struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start); 30struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start);
34#else 31#else
@@ -138,6 +135,9 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
138 struct percpu_ref *ref, struct vmem_altmap *altmap); 135 struct percpu_ref *ref, struct vmem_altmap *altmap);
139struct dev_pagemap *find_dev_pagemap(resource_size_t phys); 136struct dev_pagemap *find_dev_pagemap(resource_size_t phys);
140 137
138unsigned long vmem_altmap_offset(struct vmem_altmap *altmap);
139void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns);
140
141static inline bool is_zone_device_page(const struct page *page); 141static inline bool is_zone_device_page(const struct page *page);
142#else 142#else
143static inline void *devm_memremap_pages(struct device *dev, 143static inline void *devm_memremap_pages(struct device *dev,
@@ -157,7 +157,17 @@ static inline struct dev_pagemap *find_dev_pagemap(resource_size_t phys)
157{ 157{
158 return NULL; 158 return NULL;
159} 159}
160#endif 160
161static inline unsigned long vmem_altmap_offset(struct vmem_altmap *altmap)
162{
163 return 0;
164}
165
166static inline void vmem_altmap_free(struct vmem_altmap *altmap,
167 unsigned long nr_pfns)
168{
169}
170#endif /* CONFIG_ZONE_DEVICE */
161 171
162#if defined(CONFIG_DEVICE_PRIVATE) || defined(CONFIG_DEVICE_PUBLIC) 172#if defined(CONFIG_DEVICE_PRIVATE) || defined(CONFIG_DEVICE_PUBLIC)
163static inline bool is_device_private_page(const struct page *page) 173static inline bool is_device_private_page(const struct page *page)