[09/28] seccomp: Use tid_real member name

Submitted by Cyrill Gorcunov on March 20, 2018, 9:42 p.m.

Details

Message ID 20180320214313.25326-10-gorcunov@gmail.com
State Rejected
Series "seccomp, v2: Add support for per-thread tracking"
Headers show

Commit Message

Cyrill Gorcunov March 20, 2018, 9:42 p.m.
From: Cyrill Gorcunov <gorcunov@virtuozzo.com>

We operate with real pids on the node, reflect it.

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
---
 criu/include/seccomp.h |  6 +++---
 criu/seccomp.c         | 20 ++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/include/seccomp.h b/criu/include/seccomp.h
index 2eab28b1f0c1..f21f493e17a0 100644
--- a/criu/include/seccomp.h
+++ b/criu/include/seccomp.h
@@ -30,12 +30,12 @@ 
 struct pstree_item;
 
 struct seccomp_entry {
-	pid_t			tid;
+	pid_t			tid_real;
 	unsigned int		mode;
 };
 
-extern struct seccomp_entry *seccomp_find_entry(const struct pstree_item *item, pid_t tid);
-extern int seccomp_collect_entry(const struct pstree_item *item, pid_t tid, unsigned int mode);
+extern struct seccomp_entry *seccomp_find_entry(const struct pstree_item *item, pid_t tid_real);
+extern int seccomp_collect_entry(const struct pstree_item *item, pid_t tid_real, unsigned int mode);
 
 struct seccomp_info {
 	struct seccomp_info	*prev;
diff --git a/criu/seccomp.c b/criu/seccomp.c
index 00a1a94656b7..849f972dd834 100644
--- a/criu/seccomp.c
+++ b/criu/seccomp.c
@@ -21,22 +21,22 @@ 
 #undef	LOG_PREFIX
 #define LOG_PREFIX "seccomp: "
 
-struct seccomp_entry *seccomp_find_entry(const struct pstree_item *item, pid_t tid)
+struct seccomp_entry *seccomp_find_entry(const struct pstree_item *item, pid_t tid_real)
 {
 	struct dmp_info *dinfo = dmpi(item);
 	size_t i;
 
 	for (i = 0; i < dinfo->nr_seccomp_entry; i++) {
-		if (dinfo->seccomp_entry[i].tid == tid)
+		if (dinfo->seccomp_entry[i].tid_real == tid_real)
 			return &dinfo->seccomp_entry[i];
 	}
 
-	pr_err("Can't find entry on pid %d tid %d (%zu entries)\n",
-	       item->pid->real, tid, dinfo->nr_seccomp_entry);
+	pr_err("Can't find entry on pid_real %d tid_real %d (%zu entries)\n",
+	       item->pid->real, tid_real, dinfo->nr_seccomp_entry);
 	return NULL;
 }
 
-int seccomp_collect_entry(const struct pstree_item *item, pid_t tid, unsigned int mode)
+int seccomp_collect_entry(const struct pstree_item *item, pid_t tid_real, unsigned int mode)
 {
 	struct dmp_info *dinfo = dmpi(item);
 	struct seccomp_entry *entry;
@@ -44,18 +44,18 @@  int seccomp_collect_entry(const struct pstree_item *item, pid_t tid, unsigned in
 
 	new_size = sizeof(*dinfo->seccomp_entry) * (dinfo->nr_seccomp_entry + 1);
 	if (xrealloc_safe(&dinfo->seccomp_entry, new_size)) {
-		pr_err("Can't collect seccomp entry for item %d tid %d\n",
-		       item->pid->real, tid);
+		pr_err("Can't collect seccomp entry for item %d tid_real %d\n",
+		       item->pid->real, tid_real);
 		return -ENOMEM;
 	}
 
 	entry		= &dinfo->seccomp_entry[dinfo->nr_seccomp_entry];
-	entry->tid	= tid;
+	entry->tid_real	= tid_real;
 	entry->mode	= mode;
 
 	dinfo->nr_seccomp_entry++;
-	pr_debug("Collected tid %d mode %#x (%zu entries)\n",
-		 tid, mode, dinfo->nr_seccomp_entry);
+	pr_debug("Collected tid_real %d mode %#x (%zu entries)\n",
+		 tid_real, mode, dinfo->nr_seccomp_entry);
 	return 0;
 }