Commit c8d5f1a2 authored by Pavel Emelyanov's avatar Pavel Emelyanov

vma: Use vma_area_is helper where appropriate

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 98fbeb8d
...@@ -218,7 +218,7 @@ static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr, ...@@ -218,7 +218,7 @@ static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr,
unsigned long nr_pages, size; unsigned long nr_pages, size;
struct vma_area *p = *pvma; struct vma_area *p = *pvma;
if (vma_entry_is(&vma->vma, VMA_FILE_PRIVATE)) { if (vma_area_is(vma, VMA_FILE_PRIVATE)) {
ret = get_filemap_fd(pid, &vma->vma); ret = get_filemap_fd(pid, &vma->vma);
if (ret < 0) { if (ret < 0) {
pr_err("Can't fixup VMA's fd\n"); pr_err("Can't fixup VMA's fd\n");
...@@ -311,7 +311,7 @@ static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr, ...@@ -311,7 +311,7 @@ static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr,
vma->premmaped_addr += PAGE_SIZE; vma->premmaped_addr += PAGE_SIZE;
} }
if (vma_entry_is(&vma->vma, VMA_FILE_PRIVATE)) if (vma_area_is(vma, VMA_FILE_PRIVATE))
close(vma->vma.fd); close(vma->vma.fd);
return size; return size;
...@@ -603,20 +603,20 @@ static int open_vmas(int pid) ...@@ -603,20 +603,20 @@ static int open_vmas(int pid)
int ret = 0; int ret = 0;
list_for_each_entry(vma, &rst_vmas.h, list) { list_for_each_entry(vma, &rst_vmas.h, list) {
if (!(vma_entry_is(&vma->vma, VMA_AREA_REGULAR))) if (!(vma_area_is(vma, VMA_AREA_REGULAR)))
continue; continue;
pr_info("Opening 0x%016"PRIx64"-0x%016"PRIx64" 0x%016"PRIx64" (%x) vma\n", pr_info("Opening 0x%016"PRIx64"-0x%016"PRIx64" 0x%016"PRIx64" (%x) vma\n",
vma->vma.start, vma->vma.end, vma->vma.start, vma->vma.end,
vma->vma.pgoff, vma->vma.status); vma->vma.pgoff, vma->vma.status);
if (vma_entry_is(&vma->vma, VMA_AREA_SYSVIPC)) if (vma_area_is(vma, VMA_AREA_SYSVIPC))
ret = vma->vma.shmid; ret = vma->vma.shmid;
else if (vma_entry_is(&vma->vma, VMA_ANON_SHARED)) else if (vma_area_is(vma, VMA_ANON_SHARED))
ret = get_shmem_fd(pid, &vma->vma); ret = get_shmem_fd(pid, &vma->vma);
else if (vma_entry_is(&vma->vma, VMA_FILE_SHARED)) else if (vma_area_is(vma, VMA_FILE_SHARED))
ret = get_filemap_fd(pid, &vma->vma); ret = get_filemap_fd(pid, &vma->vma);
else if (vma_entry_is(&vma->vma, VMA_AREA_SOCKET)) else if (vma_area_is(vma, VMA_AREA_SOCKET))
ret = get_socket_fd(pid, &vma->vma); ret = get_socket_fd(pid, &vma->vma);
else else
continue; continue;
......
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