[CRIU] [PATCH 17/28] seccomp: Rename last_filter to img_filter_pos
Cyrill Gorcunov
gorcunov at gmail.com
Wed Mar 21 00:43:02 MSK 2018
From: Cyrill Gorcunov <gorcunov at virtuozzo.com>
Because it is a position in dumped image array.
Signed-off-by: Cyrill Gorcunov <gorcunov at virtuozzo.com>
---
criu/include/seccomp.h | 2 +-
criu/seccomp.c | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/criu/include/seccomp.h b/criu/include/seccomp.h
index c1c1bf4c3be4..47c24c9719c1 100644
--- a/criu/include/seccomp.h
+++ b/criu/include/seccomp.h
@@ -55,7 +55,7 @@ struct seccomp_entry {
struct rb_node node;
struct seccomp_entry *next;
pid_t tid_real;
- size_t last_filter;
+ size_t img_filter_pos;
unsigned int mode;
struct seccomp_filter_chain *chain;
diff --git a/criu/seccomp.c b/criu/seccomp.c
index f73bcfbaaa1a..76b0acdf9372 100644
--- a/criu/seccomp.c
+++ b/criu/seccomp.c
@@ -120,7 +120,7 @@ int seccomp_dump_thread(pid_t tid_real, ThreadCoreEntry *thread_core)
if (entry->mode == SECCOMP_MODE_FILTER) {
thread_core->has_seccomp_filter = true;
- thread_core->seccomp_filter = entry->last_filter;
+ thread_core->seccomp_filter = entry->img_filter_pos;
}
}
@@ -231,7 +231,7 @@ static int dump_seccomp_filters(void)
SeccompEntry se = SECCOMP_ENTRY__INIT;
struct seccomp_filter_chain *chain;
struct seccomp_entry *entry;
- size_t last_filter = 0, nr_chains = 0;
+ size_t img_filter_pos = 0, nr_chains = 0;
struct rb_node *node;
int ret;
@@ -252,17 +252,17 @@ static int dump_seccomp_filters(void)
continue;
for (chain = entry->chain; chain; chain = chain->prev) {
- BUG_ON(last_filter >= nr_chains);
+ BUG_ON(img_filter_pos >= nr_chains);
- se.seccomp_filters[last_filter] = &chain->filter;
+ se.seccomp_filters[img_filter_pos] = &chain->filter;
if (chain != entry->chain) {
chain->filter.has_prev = true;
- chain->filter.prev = last_filter - 1;
+ chain->filter.prev = img_filter_pos - 1;
}
- last_filter++;
+ img_filter_pos++;
}
- entry->last_filter = last_filter - 1;
+ entry->img_filter_pos = img_filter_pos - 1;
}
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_SECCOMP), &se, PB_SECCOMP);
--
2.14.3
More information about the CRIU
mailing list