Merge tag 'lsk-v3.10-15.04-android'
[firefly-linux-kernel-4.4.55.git] / include / linux / mm_types.h
index 10a9a17342fcd83be68560170b1528262880a8fc..c14df44a95672f5404952a56d3606aa59fa77b72 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;
 
        /*
@@ -465,6 +470,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;
+}
 #if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
 /*
  * Memory barriers to keep this state in sync are graciously provided by