Linux Kernel
3.7.1
|
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/export.h>
#include <linux/err.h>
#include <linux/sched.h>
#include <linux/security.h>
#include <asm/uaccess.h>
#include "internal.h"
#include <trace/events/kmem.h>
Go to the source code of this file.
Macros | |
#define | CREATE_TRACE_POINTS |
|
read |
get_user_pages_fast() - pin user pages in memory : starting user address : number of pages from start to pin : whether pages will be written to : array that receives pointers to the pages pinned. Should be at least nr_pages long.
Returns number of pages pinned. This may be fewer than the number requested. If nr_pages is 0 or negative, returns 0. If no pages were pinned, returns -errno.
get_user_pages_fast provides equivalent functionality to get_user_pages, operating on current and current->mm, with force=0 and vma=NULL. However unlike get_user_pages, it must be called without mmap_sem held.
get_user_pages_fast may take mmap_sem and page table locks, so no assumptions can be made about lack of locking. get_user_pages_fast is to be implemented in a way that is advantageous (vs get_user_pages()) when the user memory area is already faulted in and present in ptes. However if the pages have to be faulted in, it may turn out to be slightly slower so callers need to carefully consider what to use. On many architectures, get_user_pages_fast simply falls back to get_user_pages.
__krealloc - like krealloc() but don't free .
: object to reallocate memory for. : how many bytes of memory are required. : the type of memory to allocate.
This function is like krealloc() except it never frees the originally allocated buffer. Use this if you don't want to free the buffer immediately like, for example, with RCU.
void __vma_link_list | ( | struct mm_struct * | mm, |
struct vm_area_struct * | vma, | ||
struct vm_area_struct * | prev, | ||
struct rb_node * | rb_parent | ||
) |
EXPORT_SYMBOL | ( | kstrdup | ) |
EXPORT_SYMBOL | ( | kstrndup | ) |
EXPORT_SYMBOL | ( | kmemdup | ) |
EXPORT_SYMBOL | ( | memdup_user | ) |
EXPORT_SYMBOL | ( | __krealloc | ) |
EXPORT_SYMBOL | ( | krealloc | ) |
EXPORT_SYMBOL | ( | kzfree | ) |
EXPORT_SYMBOL | ( | strndup_user | ) |
EXPORT_SYMBOL | ( | vm_mmap | ) |
EXPORT_SYMBOL_GPL | ( | __get_user_pages_fast | ) |
EXPORT_SYMBOL_GPL | ( | get_user_pages_fast | ) |
EXPORT_TRACEPOINT_SYMBOL | ( | kmalloc | ) |
EXPORT_TRACEPOINT_SYMBOL | ( | kmem_cache_alloc | ) |
EXPORT_TRACEPOINT_SYMBOL | ( | kmalloc_node | ) |
EXPORT_TRACEPOINT_SYMBOL | ( | kmem_cache_alloc_node | ) |
EXPORT_TRACEPOINT_SYMBOL | ( | kfree | ) |
EXPORT_TRACEPOINT_SYMBOL | ( | kmem_cache_free | ) |
krealloc - reallocate memory. The contents will remain unchanged. : object to reallocate memory for. : how many bytes of memory are required. : the type of memory to allocate.
The contents of the object pointed to are preserved up to the lesser of the new and old sizes. If is
NULL, krealloc() behaves exactly like kmalloc(). If is 0 and is
not a NULL pointer, the object pointed to is freed.
kzfree - like kfree but zero memory : object to free memory of
The memory of the object points
to is zeroed before freed. If is
NULL, kzfree() does nothing.
Note: this function zeroes the whole allocated buffer which can be a good deal bigger than the requested buffer size passed to kmalloc(). So be careful when using this function in performance sensitive code.
pid_t vm_is_stack | ( | struct task_struct * | task, |
struct vm_area_struct * | vma, | ||
int | in_group | ||
) |