rk: gcc-wrapper.py ignore memcontrol.c:5355
[firefly-linux-kernel-4.4.55.git] / include / linux / mm_types.h
index f8d1492a114f4447d0d7f4dfd8136e854a4a7581..0a732c5e0de1a0a880ae10048566df7a0af9ae50 100644 (file)
@@ -323,11 +323,18 @@ struct vm_area_struct {
        /*
         * For areas with an address space and backing store,
         * linkage into the address_space->i_mmap interval tree.
+        *
+        * 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;
-       } shared;
+       union {
+               struct {
+                       struct rb_node rb;
+                       unsigned long rb_subtree_last;
+               } shared;
+               const char __user *anon_name;
+       };
 
        /*
         * A file's MAP_PRIVATE vma can be in both i_mmap tree and anon_vma
@@ -591,4 +598,13 @@ typedef struct {
        unsigned long val;
 } swp_entry_t;
 
+/* 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->anon_name;
+}
+
 #endif /* _LINUX_MM_TYPES_H */