mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +00:00
fd: Remove per-filetype make_gen_id abstraction
It doesn't makemuch sense in pulling this further. The generic genid generation seems to be enough for eny file type. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -132,7 +132,7 @@ static int collect_fds(pid_t pid, int *fd, int *nr_fd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 make_gen_id(const struct fd_parms *p)
|
static u32 make_gen_id(const struct fd_parms *p)
|
||||||
{
|
{
|
||||||
return MAKE_FD_GENID(p->stat.st_dev, p->stat.st_ino, p->pos);
|
return MAKE_FD_GENID(p->stat.st_dev, p->stat.st_ino, p->pos);
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ int do_dump_gen_file(struct fd_parms *p, int lfd,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
e.type = ops->type;
|
e.type = ops->type;
|
||||||
e.id = ops->make_gen_id(p);
|
e.id = make_gen_id(p);
|
||||||
e.fd = p->fd;
|
e.fd = p->fd;
|
||||||
e.flags = p->fd_flags;
|
e.flags = p->fd_flags;
|
||||||
|
|
||||||
|
@@ -79,7 +79,6 @@ static int dump_one_eventfd(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
static const struct fdtype_ops eventfd_ops = {
|
static const struct fdtype_ops eventfd_ops = {
|
||||||
.type = FD_TYPES__EVENTFD,
|
.type = FD_TYPES__EVENTFD,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_eventfd,
|
.dump = dump_one_eventfd,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -91,7 +91,6 @@ static int dump_one_eventpoll(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
static const struct fdtype_ops eventpoll_ops = {
|
static const struct fdtype_ops eventpoll_ops = {
|
||||||
.type = FD_TYPES__EVENTPOLL,
|
.type = FD_TYPES__EVENTPOLL,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_eventpoll,
|
.dump = dump_one_eventpoll,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
1
fifo.c
1
fifo.c
@@ -65,7 +65,6 @@ static int dump_one_fifo(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
static const struct fdtype_ops fifo_ops = {
|
static const struct fdtype_ops fifo_ops = {
|
||||||
.type = FD_TYPES__FIFO,
|
.type = FD_TYPES__FIFO,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_fifo,
|
.dump = dump_one_fifo,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -341,7 +341,6 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
static const struct fdtype_ops regfile_ops = {
|
static const struct fdtype_ops regfile_ops = {
|
||||||
.type = FD_TYPES__REG,
|
.type = FD_TYPES__REG,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_reg_file,
|
.dump = dump_one_reg_file,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -66,11 +66,9 @@ struct file_desc {
|
|||||||
|
|
||||||
struct fdtype_ops {
|
struct fdtype_ops {
|
||||||
unsigned int type;
|
unsigned int type;
|
||||||
u32 (*make_gen_id)(const struct fd_parms *p);
|
|
||||||
int (*dump)(int lfd, u32 id, const struct fd_parms *p);
|
int (*dump)(int lfd, u32 id, const struct fd_parms *p);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern u32 make_gen_id(const struct fd_parms *p);
|
|
||||||
extern int do_dump_gen_file(struct fd_parms *p, int lfd,
|
extern int do_dump_gen_file(struct fd_parms *p, int lfd,
|
||||||
const struct fdtype_ops *ops,
|
const struct fdtype_ops *ops,
|
||||||
const struct cr_fdset *cr_fdset);
|
const struct cr_fdset *cr_fdset);
|
||||||
|
@@ -97,7 +97,6 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
static const struct fdtype_ops inotify_ops = {
|
static const struct fdtype_ops inotify_ops = {
|
||||||
.type = FD_TYPES__INOTIFY,
|
.type = FD_TYPES__INOTIFY,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_inotify,
|
.dump = dump_one_inotify,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
1
pipes.c
1
pipes.c
@@ -441,7 +441,6 @@ static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
static const struct fdtype_ops pipe_ops = {
|
static const struct fdtype_ops pipe_ops = {
|
||||||
.type = FD_TYPES__PIPE,
|
.type = FD_TYPES__PIPE,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_pipe,
|
.dump = dump_one_pipe,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -62,7 +62,6 @@ static int dump_one_signalfd(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
static const struct fdtype_ops signalfd_ops = {
|
static const struct fdtype_ops signalfd_ops = {
|
||||||
.type = FD_TYPES__SIGNALFD,
|
.type = FD_TYPES__SIGNALFD,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_signalfd,
|
.dump = dump_one_signalfd,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -240,7 +240,6 @@ err:
|
|||||||
|
|
||||||
static const struct fdtype_ops inet_dump_ops = {
|
static const struct fdtype_ops inet_dump_ops = {
|
||||||
.type = FD_TYPES__INETSK,
|
.type = FD_TYPES__INETSK,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_inet_fd,
|
.dump = dump_one_inet_fd,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -83,7 +83,6 @@ static int dump_one_packet_fd(int lfd, u32 id, const struct fd_parms *p)
|
|||||||
|
|
||||||
static const struct fdtype_ops packet_dump_ops = {
|
static const struct fdtype_ops packet_dump_ops = {
|
||||||
.type = FD_TYPES__PACKETSK,
|
.type = FD_TYPES__PACKETSK,
|
||||||
.make_gen_id = make_gen_id,
|
|
||||||
.dump = dump_one_packet_fd,
|
.dump = dump_one_packet_fd,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user