[CRIU] [PATCH] proc: Drop always true last argument of parse_smaps()

Pavel Emelyanov xemul at parallels.com
Fri Dec 19 04:57:28 PST 2014


Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 cr-dump.c            |  2 +-
 include/proc_parse.h |  2 +-
 proc_parse.c         | 13 ++++---------
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index 9c9753d..98db10f 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -150,7 +150,7 @@ int collect_mappings(pid_t pid, struct vm_area_list *vma_area_list)
 	pr_info("Collecting mappings (pid: %d)\n", pid);
 	pr_info("----------------------------------------\n");
 
-	ret = parse_smaps(pid, vma_area_list, true);
+	ret = parse_smaps(pid, vma_area_list);
 	if (ret < 0)
 		goto err;
 
diff --git a/include/proc_parse.h b/include/proc_parse.h
index a75efe9..792cf06 100644
--- a/include/proc_parse.h
+++ b/include/proc_parse.h
@@ -155,7 +155,7 @@ struct vm_area_list;
 
 extern struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid);
 extern int parse_pid_stat(pid_t pid, struct proc_pid_stat *s);
-extern int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, bool use_map_files);
+extern int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list);
 extern int parse_self_maps_lite(struct vm_area_list *vms);
 extern int parse_pid_status(pid_t pid, struct proc_status_creds *);
 
diff --git a/proc_parse.c b/proc_parse.c
index 7ec3832..649ecbb 100644
--- a/proc_parse.c
+++ b/proc_parse.c
@@ -196,9 +196,6 @@ static int vma_get_mapfile(struct vma_area *vma, DIR *mfd,
 {
 	char path[32];
 
-	if (!mfd)
-		return 0;
-
 	if (prev_vfi->vma && vfi_equal(vfi, prev_vfi)) {
 		struct vma_area *prev = prev_vfi->vma;
 
@@ -292,7 +289,7 @@ int parse_self_maps_lite(struct vm_area_list *vms)
 	return 0;
 }
 
-int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, bool use_map_files)
+int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list)
 {
 	struct vma_area *vma_area = NULL;
 	unsigned long start, end, pgoff, prev_end = 0;
@@ -316,11 +313,9 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, bool use_map_file
 	if (bfdopen(&f, O_RDONLY))
 		goto err_n;
 
-	if (use_map_files) {
-		map_files_dir = opendir_proc(pid, "map_files");
-		if (!map_files_dir) /* old kernel? */
-			goto err;
-	}
+	map_files_dir = opendir_proc(pid, "map_files");
+	if (!map_files_dir) /* old kernel? */
+		goto err;
 
 	while (1) {
 		int num;
-- 
1.8.4.2



More information about the CRIU mailing list