Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: remove mm/io-mapping.c

This is dead code, which was used from commit b739f125e4eb ("i915: use
io_mapping_map_user") but reverted a month later by commit 0e4fe0c9f2f9
("Revert "i915: use io_mapping_map_user"") back in 2021.

Since then nobody has used it, so remove it.

[akpm@linux-foundation.org: update Documentation/core-api/mm-api.rst, per Vlastimil]
Link: https://lkml.kernel.org/r/20250725142901.81502-1-lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Lorenzo Stoakes and committed by
Andrew Morton
9a4f90e2 22d02290

-39
-1
Documentation/core-api/mm-api.rst
··· 139 139 .. kernel-doc:: mm/mmu_notifier.c 140 140 .. kernel-doc:: mm/balloon_compaction.c 141 141 .. kernel-doc:: mm/huge_memory.c 142 - .. kernel-doc:: mm/io-mapping.c
-3
include/linux/io-mapping.h
··· 225 225 kfree(iomap); 226 226 } 227 227 228 - int io_mapping_map_user(struct io_mapping *iomap, struct vm_area_struct *vma, 229 - unsigned long addr, unsigned long pfn, unsigned long size); 230 - 231 228 #endif /* _LINUX_IO_MAPPING_H */
-4
mm/Kconfig
··· 1242 1242 config KMAP_LOCAL_NON_LINEAR_PTE_ARRAY 1243 1243 bool 1244 1244 1245 - # struct io_mapping based helper. Selected by drivers that need them 1246 - config IO_MAPPING 1247 - bool 1248 - 1249 1245 config MEMFD_CREATE 1250 1246 bool "Enable memfd_create() system call" if EXPERT 1251 1247
-1
mm/Makefile
··· 141 141 obj-$(CONFIG_MAPPING_DIRTY_HELPERS) += mapping_dirty_helpers.o 142 142 obj-$(CONFIG_PTDUMP) += ptdump.o 143 143 obj-$(CONFIG_PAGE_REPORTING) += page_reporting.o 144 - obj-$(CONFIG_IO_MAPPING) += io-mapping.o 145 144 obj-$(CONFIG_HAVE_BOOTMEM_INFO_NODE) += bootmem_info.o 146 145 obj-$(CONFIG_GENERIC_IOREMAP) += ioremap.o 147 146 obj-$(CONFIG_SHRINKER_DEBUG) += shrinker_debug.o
-30
mm/io-mapping.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - 3 - #include <linux/mm.h> 4 - #include <linux/io-mapping.h> 5 - 6 - /** 7 - * io_mapping_map_user - remap an I/O mapping to userspace 8 - * @iomap: the source io_mapping 9 - * @vma: user vma to map to 10 - * @addr: target user address to start at 11 - * @pfn: physical address of kernel memory 12 - * @size: size of map area 13 - * 14 - * Note: this is only safe if the mm semaphore is held when called. 15 - */ 16 - int io_mapping_map_user(struct io_mapping *iomap, struct vm_area_struct *vma, 17 - unsigned long addr, unsigned long pfn, unsigned long size) 18 - { 19 - vm_flags_t expected_flags = VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP; 20 - 21 - if (WARN_ON_ONCE((vma->vm_flags & expected_flags) != expected_flags)) 22 - return -EINVAL; 23 - 24 - pgprot_t remap_prot = __pgprot((pgprot_val(iomap->prot) & _PAGE_CACHE_MASK) | 25 - (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK)); 26 - 27 - /* We rely on prevalidation of the io-mapping to skip pfnmap tracking. */ 28 - return remap_pfn_range_notrack(vma, addr, pfn, size, remap_prot); 29 - } 30 - EXPORT_SYMBOL_GPL(io_mapping_map_user);