Commit 51133437 authored by Pavel Emelyanov's avatar Pavel Emelyanov

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: 's avatarPavel Emelyanov <xemul@parallels.com>
parent acba1e9b
......@@ -132,7 +132,7 @@ static int collect_fds(pid_t pid, int *fd, int *nr_fd)
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);
}
......@@ -144,7 +144,7 @@ int do_dump_gen_file(struct fd_parms *p, int lfd,
int ret = -1;
e.type = ops->type;
e.id = ops->make_gen_id(p);
e.id = make_gen_id(p);
e.fd = p->fd;
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 = {
.type = FD_TYPES__EVENTFD,
.make_gen_id = make_gen_id,
.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 = {
.type = FD_TYPES__EVENTPOLL,
.make_gen_id = make_gen_id,
.dump = dump_one_eventpoll,
};
......
......@@ -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 = {
.type = FD_TYPES__FIFO,
.make_gen_id = make_gen_id,
.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 = {
.type = FD_TYPES__REG,
.make_gen_id = make_gen_id,
.dump = dump_one_reg_file,
};
......
......@@ -66,11 +66,9 @@ struct file_desc {
struct fdtype_ops {
unsigned int type;
u32 (*make_gen_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,
const struct fdtype_ops *ops,
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 = {
.type = FD_TYPES__INOTIFY,
.make_gen_id = make_gen_id,
.dump = dump_one_inotify,
};
......
......@@ -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 = {
.type = FD_TYPES__PIPE,
.make_gen_id = make_gen_id,
.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 = {
.type = FD_TYPES__SIGNALFD,
.make_gen_id = make_gen_id,
.dump = dump_one_signalfd,
};
......
......@@ -240,7 +240,6 @@ err:
static const struct fdtype_ops inet_dump_ops = {
.type = FD_TYPES__INETSK,
.make_gen_id = make_gen_id,
.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 = {
.type = FD_TYPES__PACKETSK,
.make_gen_id = make_gen_id,
.dump = dump_one_packet_fd,
};
......
......@@ -223,7 +223,6 @@ err:
static const struct fdtype_ops unix_dump_ops = {
.type = FD_TYPES__UNIXSK,
.make_gen_id = make_gen_id,
.dump = dump_one_unix_fd,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment