diff options
Diffstat (limited to 'include/linux/mm_types.h')
-rw-r--r-- | include/linux/mm_types.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 8d37e26a1007..0ade1cad74fd 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -281,11 +281,19 @@ struct vm_area_struct { /* * For areas with an address space and backing store, - * linkage into the address_space->i_mmap interval tree. + * linkage into the address_space->i_mmap interval tree, or + * linkage of vma in the address_space->i_mmap_nonlinear list. + * + * For private anonymous mappings, a pointer to a null terminated string + * in the user process containing the name given to the vma, or NULL + * if unnamed. */ - struct { - struct rb_node rb; - unsigned long rb_subtree_last; + union { + struct { + struct rb_node rb; + unsigned long rb_subtree_last; + } linear; + const char __user *anon_name; } shared; /* @@ -523,6 +531,15 @@ static inline void clear_tlb_flush_pending(struct mm_struct *mm) } #endif +/* Return the name for an anonymous mapping or NULL for a file-backed mapping */ +static inline const char __user *vma_get_anon_name(struct vm_area_struct *vma) +{ + if (vma->vm_file) + return NULL; + + return vma->shared.anon_name; +} + struct vm_special_mapping { const char *name; |