mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-03 07:45:17 +00:00
fd: Remove fs_is_special
It's no longer required. All the previously special fds are now scattered over other images. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -227,11 +227,6 @@ int fd_id_generate(pid_t pid, struct fdinfo_entry *fe)
|
|||||||
struct fd_id_entry *fid;
|
struct fd_id_entry *fid;
|
||||||
int new_id = 0;
|
int new_id = 0;
|
||||||
|
|
||||||
if (fd_is_special(fe)) {
|
|
||||||
fe->id = fd_id_generate_special();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
fid = fd_id_generate_gen(pid, fe, &new_id);
|
fid = fd_id_generate_gen(pid, fe, &new_id);
|
||||||
if (!fid)
|
if (!fid)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
23
files.c
23
files.c
@@ -216,9 +216,6 @@ int prepare_fd_pid(int pid)
|
|||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (fd_is_special(&e))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
ret = collect_fd(pid, &e);
|
ret = collect_fd(pid, &e);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
break;
|
break;
|
||||||
@@ -443,8 +440,6 @@ static int open_fdinfo(int pid, struct fdinfo_entry *fe, int *fdinfo_fd, int sta
|
|||||||
|
|
||||||
pr_info("\t%d: Got fd for %lx\n", pid, fe->addr);
|
pr_info("\t%d: Got fd for %lx\n", pid, fe->addr);
|
||||||
|
|
||||||
BUG_ON(fd_is_special(fe));
|
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case FD_STATE_PREP:
|
case FD_STATE_PREP:
|
||||||
ret = open_transport_fd(pid, fe, fdesc);
|
ret = open_transport_fd(pid, fe, fdesc);
|
||||||
@@ -460,17 +455,6 @@ static int open_fdinfo(int pid, struct fdinfo_entry *fe, int *fdinfo_fd, int sta
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int open_special_fdinfo(int pid, struct fdinfo_entry *fe,
|
|
||||||
int fdinfo_fd, int state)
|
|
||||||
{
|
|
||||||
if (state != FD_STATE_RECV)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
pr_info("%d: fe->type: %d\n", pid, fe->type);
|
|
||||||
BUG_ON(1);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int prepare_fds(int pid)
|
int prepare_fds(int pid)
|
||||||
{
|
{
|
||||||
u32 type = 0, ret;
|
u32 type = 0, ret;
|
||||||
@@ -499,12 +483,7 @@ int prepare_fds(int pid)
|
|||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (fd_is_special(&fe))
|
ret = open_fdinfo(pid, &fe, &fdinfo_fd, state);
|
||||||
ret = open_special_fdinfo(pid, &fe,
|
|
||||||
fdinfo_fd, state);
|
|
||||||
else
|
|
||||||
ret = open_fdinfo(pid, &fe, &fdinfo_fd, state);
|
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -61,8 +61,6 @@ struct fdinfo_entry {
|
|||||||
u32 id;
|
u32 id;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
#define fd_is_special(fe) (0)
|
|
||||||
|
|
||||||
struct fs_entry {
|
struct fs_entry {
|
||||||
u32 cwd_id;
|
u32 cwd_id;
|
||||||
u32 root_id;
|
u32 root_id;
|
||||||
|
Reference in New Issue
Block a user