[CRIU] [PATCH 6/9] unix: Collect bindmounted unix sockets into own list
Cyrill Gorcunov
gorcunov at gmail.com
Sat Jun 9 16:26:08 MSK 2018
So when we will be examinating mount points and
sockets we won't waste time on non-bindmounted.
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
criu/sk-unix.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 1714154b4213..d1a97759966d 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -97,6 +97,7 @@ static mutex_t *mutex_ghost;
static LIST_HEAD(unix_sockets);
static LIST_HEAD(unix_ghost_addr);
+static LIST_HEAD(unix_mnt_sockets);
static int unix_resolve_name(int lfd, uint32_t id, struct unix_sk_desc *d,
UnixSkEntry *ue, const struct fd_parms *p);
@@ -971,6 +972,7 @@ int collect_unix_bindmounts(void)
struct unix_sk_info {
UnixSkEntry *ue;
struct list_head list;
+ struct list_head mnt_list;
char *name;
char *name_dir;
unsigned flags;
@@ -2127,6 +2129,7 @@ static int init_unix_sk_info(struct unix_sk_info *ui, UnixSkEntry *ue)
memzero(&ui->d, sizeof(ui->d));
INIT_LIST_HEAD(&ui->list);
+ INIT_LIST_HEAD(&ui->mnt_list);
INIT_LIST_HEAD(&ui->connected);
INIT_LIST_HEAD(&ui->node);
INIT_LIST_HEAD(&ui->scm_fles);
@@ -2220,6 +2223,9 @@ static int collect_one_unixsk(void *o, ProtobufCMessage *base, struct cr_img *i)
list_add_tail(&ui->ghost_node, &unix_ghost_addr);
}
+ if (ui->ue->uflags & UNIX_UFLAGS__BINDMOUNT)
+ list_add_tail(&ui->mnt_list, &unix_mnt_sockets);
+
list_add_tail(&ui->list, &unix_sockets);
return file_desc_add(&ui->d, ui->ue->id, &unix_desc_ops);
}
--
2.14.4
More information about the CRIU
mailing list