aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h52
1 files changed, 28 insertions, 24 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index ea818ff739cd..ad06d42adb1a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1312,8 +1312,6 @@ void free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
1312 unsigned long end, unsigned long floor, unsigned long ceiling); 1312 unsigned long end, unsigned long floor, unsigned long ceiling);
1313int copy_page_range(struct mm_struct *dst, struct mm_struct *src, 1313int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
1314 struct vm_area_struct *vma); 1314 struct vm_area_struct *vma);
1315void unmap_mapping_range(struct address_space *mapping,
1316 loff_t const holebegin, loff_t const holelen, int even_cows);
1317int follow_pte_pmd(struct mm_struct *mm, unsigned long address, 1315int follow_pte_pmd(struct mm_struct *mm, unsigned long address,
1318 unsigned long *start, unsigned long *end, 1316 unsigned long *start, unsigned long *end,
1319 pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp); 1317 pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp);
@@ -1324,12 +1322,6 @@ int follow_phys(struct vm_area_struct *vma, unsigned long address,
1324int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, 1322int generic_access_phys(struct vm_area_struct *vma, unsigned long addr,
1325 void *buf, int len, int write); 1323 void *buf, int len, int write);
1326 1324
1327static inline void unmap_shared_mapping_range(struct address_space *mapping,
1328 loff_t const holebegin, loff_t const holelen)
1329{
1330 unmap_mapping_range(mapping, holebegin, holelen, 0);
1331}
1332
1333extern void truncate_pagecache(struct inode *inode, loff_t new); 1325extern void truncate_pagecache(struct inode *inode, loff_t new);
1334extern void truncate_setsize(struct inode *inode, loff_t newsize); 1326extern void truncate_setsize(struct inode *inode, loff_t newsize);
1335void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to); 1327void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to);
@@ -1344,6 +1336,10 @@ extern int handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
1344extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm, 1336extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
1345 unsigned long address, unsigned int fault_flags, 1337 unsigned long address, unsigned int fault_flags,
1346 bool *unlocked); 1338 bool *unlocked);
1339void unmap_mapping_pages(struct address_space *mapping,
1340 pgoff_t start, pgoff_t nr, bool even_cows);
1341void unmap_mapping_range(struct address_space *mapping,
1342 loff_t const holebegin, loff_t const holelen, int even_cows);
1347#else 1343#else
1348static inline int handle_mm_fault(struct vm_area_struct *vma, 1344static inline int handle_mm_fault(struct vm_area_struct *vma,
1349 unsigned long address, unsigned int flags) 1345 unsigned long address, unsigned int flags)
@@ -1360,10 +1356,20 @@ static inline int fixup_user_fault(struct task_struct *tsk,
1360 BUG(); 1356 BUG();
1361 return -EFAULT; 1357 return -EFAULT;
1362} 1358}
1359static inline void unmap_mapping_pages(struct address_space *mapping,
1360 pgoff_t start, pgoff_t nr, bool even_cows) { }
1361static inline void unmap_mapping_range(struct address_space *mapping,
1362 loff_t const holebegin, loff_t const holelen, int even_cows) { }
1363#endif 1363#endif
1364 1364
1365extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, 1365static inline void unmap_shared_mapping_range(struct address_space *mapping,
1366 unsigned int gup_flags); 1366 loff_t const holebegin, loff_t const holelen)
1367{
1368 unmap_mapping_range(mapping, holebegin, holelen, 0);
1369}
1370
1371extern int access_process_vm(struct task_struct *tsk, unsigned long addr,
1372 void *buf, int len, unsigned int gup_flags);
1367extern int access_remote_vm(struct mm_struct *mm, unsigned long addr, 1373extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
1368 void *buf, int len, unsigned int gup_flags); 1374 void *buf, int len, unsigned int gup_flags);
1369extern int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm, 1375extern int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
@@ -2069,8 +2075,8 @@ static inline void zero_resv_unavail(void) {}
2069#endif 2075#endif
2070 2076
2071extern void set_dma_reserve(unsigned long new_dma_reserve); 2077extern void set_dma_reserve(unsigned long new_dma_reserve);
2072extern void memmap_init_zone(unsigned long, int, unsigned long, 2078extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long,
2073 unsigned long, enum memmap_context); 2079 enum memmap_context, struct vmem_altmap *);
2074extern void setup_per_zone_wmarks(void); 2080extern void setup_per_zone_wmarks(void);
2075extern int __meminit init_per_zone_wmark_min(void); 2081extern int __meminit init_per_zone_wmark_min(void);
2076extern void mem_init(void); 2082extern void mem_init(void);
@@ -2538,7 +2544,8 @@ void sparse_mem_maps_populate_node(struct page **map_map,
2538 unsigned long map_count, 2544 unsigned long map_count,
2539 int nodeid); 2545 int nodeid);
2540 2546
2541struct page *sparse_mem_map_populate(unsigned long pnum, int nid); 2547struct page *sparse_mem_map_populate(unsigned long pnum, int nid,
2548 struct vmem_altmap *altmap);
2542pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); 2549pgd_t *vmemmap_pgd_populate(unsigned long addr, int node);
2543p4d_t *vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node); 2550p4d_t *vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node);
2544pud_t *vmemmap_pud_populate(p4d_t *p4d, unsigned long addr, int node); 2551pud_t *vmemmap_pud_populate(p4d_t *p4d, unsigned long addr, int node);
@@ -2546,20 +2553,17 @@ pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node);
2546pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); 2553pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);
2547void *vmemmap_alloc_block(unsigned long size, int node); 2554void *vmemmap_alloc_block(unsigned long size, int node);
2548struct vmem_altmap; 2555struct vmem_altmap;
2549void *__vmemmap_alloc_block_buf(unsigned long size, int node, 2556void *vmemmap_alloc_block_buf(unsigned long size, int node);
2550 struct vmem_altmap *altmap); 2557void *altmap_alloc_block_buf(unsigned long size, struct vmem_altmap *altmap);
2551static inline void *vmemmap_alloc_block_buf(unsigned long size, int node)
2552{
2553 return __vmemmap_alloc_block_buf(size, node, NULL);
2554}
2555
2556void vmemmap_verify(pte_t *, int, unsigned long, unsigned long); 2558void vmemmap_verify(pte_t *, int, unsigned long, unsigned long);
2557int vmemmap_populate_basepages(unsigned long start, unsigned long end, 2559int vmemmap_populate_basepages(unsigned long start, unsigned long end,
2558 int node); 2560 int node);
2559int vmemmap_populate(unsigned long start, unsigned long end, int node); 2561int vmemmap_populate(unsigned long start, unsigned long end, int node,
2562 struct vmem_altmap *altmap);
2560void vmemmap_populate_print_last(void); 2563void vmemmap_populate_print_last(void);
2561#ifdef CONFIG_MEMORY_HOTPLUG 2564#ifdef CONFIG_MEMORY_HOTPLUG
2562void vmemmap_free(unsigned long start, unsigned long end); 2565void vmemmap_free(unsigned long start, unsigned long end,
2566 struct vmem_altmap *altmap);
2563#endif 2567#endif
2564void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, 2568void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
2565 unsigned long nr_pages); 2569 unsigned long nr_pages);
@@ -2570,8 +2574,8 @@ enum mf_flags {
2570 MF_MUST_KILL = 1 << 2, 2574 MF_MUST_KILL = 1 << 2,
2571 MF_SOFT_OFFLINE = 1 << 3, 2575 MF_SOFT_OFFLINE = 1 << 3,
2572}; 2576};
2573extern int memory_failure(unsigned long pfn, int trapno, int flags); 2577extern int memory_failure(unsigned long pfn, int flags);
2574extern void memory_failure_queue(unsigned long pfn, int trapno, int flags); 2578extern void memory_failure_queue(unsigned long pfn, int flags);
2575extern int unpoison_memory(unsigned long pfn); 2579extern int unpoison_memory(unsigned long pfn);
2576extern int get_hwpoison_page(struct page *page); 2580extern int get_hwpoison_page(struct page *page);
2577#define put_hwpoison_page(page) put_page(page) 2581#define put_hwpoison_page(page) put_page(page)