Skip to content

Commit 301fa9f

Browse files
Christoph Hellwigtorvalds
authored andcommitted
mm: remove alloc_vm_area
All users are gone now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Juergen Gross <jgross@suse.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org> Cc: Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Uladzislau Rezki (Sony) <urezki@gmail.com> Link: https://lkml.kernel.org/r/20201002122204.1534411-12-hch@lst.de Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5dd63bf commit 301fa9f

3 files changed

Lines changed: 1 addition & 59 deletions

File tree

include/linux/vmalloc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size,
169169
unsigned long flags,
170170
unsigned long start, unsigned long end,
171171
const void *caller);
172+
void free_vm_area(struct vm_struct *area);
172173
extern struct vm_struct *remove_vm_area(const void *addr);
173174
extern struct vm_struct *find_vm_area(const void *addr);
174175

@@ -204,10 +205,6 @@ static inline void set_vm_flush_reset_perms(void *addr)
204205
}
205206
#endif
206207

207-
/* Allocate/destroy a 'vmalloc' VM area. */
208-
extern struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes);
209-
extern void free_vm_area(struct vm_struct *area);
210-
211208
/* for /dev/kmem */
212209
extern long vread(char *buf, char *addr, unsigned long count);
213210
extern long vwrite(char *buf, char *addr, unsigned long count);

mm/nommu.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,6 @@ void vm_unmap_aliases(void)
354354
}
355355
EXPORT_SYMBOL_GPL(vm_unmap_aliases);
356356

357-
struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes)
358-
{
359-
BUG();
360-
return NULL;
361-
}
362-
EXPORT_SYMBOL_GPL(alloc_vm_area);
363-
364357
void free_vm_area(struct vm_struct *area)
365358
{
366359
BUG();

mm/vmalloc.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,54 +3083,6 @@ int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
30833083
}
30843084
EXPORT_SYMBOL(remap_vmalloc_range);
30853085

3086-
static int f(pte_t *pte, unsigned long addr, void *data)
3087-
{
3088-
pte_t ***p = data;
3089-
3090-
if (p) {
3091-
*(*p) = pte;
3092-
(*p)++;
3093-
}
3094-
return 0;
3095-
}
3096-
3097-
/**
3098-
* alloc_vm_area - allocate a range of kernel address space
3099-
* @size: size of the area
3100-
* @ptes: returns the PTEs for the address space
3101-
*
3102-
* Returns: NULL on failure, vm_struct on success
3103-
*
3104-
* This function reserves a range of kernel address space, and
3105-
* allocates pagetables to map that range. No actual mappings
3106-
* are created.
3107-
*
3108-
* If @ptes is non-NULL, pointers to the PTEs (in init_mm)
3109-
* allocated for the VM area are returned.
3110-
*/
3111-
struct vm_struct *alloc_vm_area(size_t size, pte_t **ptes)
3112-
{
3113-
struct vm_struct *area;
3114-
3115-
area = get_vm_area_caller(size, VM_IOREMAP,
3116-
__builtin_return_address(0));
3117-
if (area == NULL)
3118-
return NULL;
3119-
3120-
/*
3121-
* This ensures that page tables are constructed for this region
3122-
* of kernel virtual address space and mapped into init_mm.
3123-
*/
3124-
if (apply_to_page_range(&init_mm, (unsigned long)area->addr,
3125-
size, f, ptes ? &ptes : NULL)) {
3126-
free_vm_area(area);
3127-
return NULL;
3128-
}
3129-
3130-
return area;
3131-
}
3132-
EXPORT_SYMBOL_GPL(alloc_vm_area);
3133-
31343086
void free_vm_area(struct vm_struct *area)
31353087
{
31363088
struct vm_struct *ret;

0 commit comments

Comments
 (0)