Merge remote-tracking branch 'origin/upstream/android-common-3.10' into linux-linaro...
[firefly-linux-kernel-4.4.55.git] / include / linux / mm_types.h
index 4a189ba6b1284b1ff152ce3e5a7d52e8c5815948..93ddd4eb910b8d398927ee29686f7f9fbcd837be 100644 (file)
@@ -255,6 +255,10 @@ struct vm_area_struct {
         * For areas with an address space and backing store,
         * 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.
         */
        union {
                struct {
@@ -262,6 +266,7 @@ struct vm_area_struct {
                        unsigned long rb_subtree_last;
                } linear;
                struct list_head nonlinear;
+               const char __user *anon_name;
        } shared;
 
        /*
@@ -457,4 +462,14 @@ static inline cpumask_t *mm_cpumask(struct mm_struct *mm)
        return mm->cpu_vm_mask_var;
 }
 
+
+/* 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;
+}
+
 #endif /* _LINUX_MM_TYPES_H */