Commit 37a6c1fc authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mm: move shmid to vma_entry (v2)

It will be used to restore shared mappings

v2: clean up
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7d108750
...@@ -439,7 +439,7 @@ static int dump_task_mappings(pid_t pid, const struct list_head *vma_area_list, ...@@ -439,7 +439,7 @@ static int dump_task_mappings(pid_t pid, const struct list_head *vma_area_list,
e.start = vma->start; e.start = vma->start;
e.end = vma->end; e.end = vma->end;
e.shmid = vma_area->shmid; e.shmid = vma_area->vma.shmid;
pr_info("shmem: s: %16lx e: %16lx shmid: %16lx\n", pr_info("shmem: s: %16lx e: %16lx shmid: %16lx\n",
e.start, e.end, e.shmid); e.start, e.end, e.shmid);
......
...@@ -151,7 +151,6 @@ void free_mappings(struct list_head *vma_area_list); ...@@ -151,7 +151,6 @@ void free_mappings(struct list_head *vma_area_list);
struct vma_area { struct vma_area {
struct list_head list; struct list_head list;
struct vma_entry vma; struct vma_entry vma;
unsigned long shmid;
int vm_file_fd; int vm_file_fd;
}; };
......
...@@ -113,6 +113,7 @@ struct vma_entry { ...@@ -113,6 +113,7 @@ struct vma_entry {
u64 start; u64 start;
u64 end; u64 end;
u64 pgoff; u64 pgoff;
u64 shmid;
u32 prot; u32 prot;
u32 flags; u32 flags;
u32 status; u32 status;
......
...@@ -157,7 +157,6 @@ extern void pr_vma(unsigned int loglevel, const struct vma_area *vma_area); ...@@ -157,7 +157,6 @@ extern void pr_vma(unsigned int loglevel, const struct vma_area *vma_area);
({ \ ({ \
struct vma_area *p__ = xzalloc(sizeof(*p__)); \ struct vma_area *p__ = xzalloc(sizeof(*p__)); \
if (p__) { \ if (p__) { \
p__->shmid = -1; \
p__->vm_file_fd = -1; \ p__->vm_file_fd = -1; \
p__->vma.fd = -1; \ p__->vma.fd = -1; \
} \ } \
......
...@@ -135,7 +135,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files) ...@@ -135,7 +135,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
goto err_bogus_mapping; goto err_bogus_mapping;
vma_area->vma.flags |= MAP_ANONYMOUS; vma_area->vma.flags |= MAP_ANONYMOUS;
vma_area->vma.status |= VMA_ANON_SHARED; vma_area->vma.status |= VMA_ANON_SHARED;
vma_area->shmid = st_buf.st_ino; vma_area->vma.shmid = st_buf.st_ino;
if (!strcmp(file_path, "/SYSV")) { if (!strcmp(file_path, "/SYSV")) {
pr_info("path: %s\n", file_path); pr_info("path: %s\n", file_path);
...@@ -153,7 +153,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files) ...@@ -153,7 +153,7 @@ int parse_maps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
*/ */
if (vma_area->vma.flags & MAP_SHARED) { if (vma_area->vma.flags & MAP_SHARED) {
vma_area->vma.status |= VMA_ANON_SHARED; vma_area->vma.status |= VMA_ANON_SHARED;
vma_area->shmid = ino; vma_area->vma.shmid = ino;
} else { } else {
vma_area->vma.status |= VMA_ANON_PRIVATE; vma_area->vma.status |= VMA_ANON_PRIVATE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment