From 51133437c98ecdb772ddba96c610ffc059d00c46 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Sat, 11 Aug 2012 22:41:29 +0400 Subject: [PATCH] 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 --- cr-dump.c | 4 ++-- eventfd.c | 1 - eventpoll.c | 1 - fifo.c | 1 - files-reg.c | 1 - include/files.h | 2 -- inotify.c | 1 - pipes.c | 1 - signalfd.c | 1 - sk-inet.c | 1 - sk-packet.c | 1 - sk-unix.c | 1 - 12 files changed, 2 insertions(+), 14 deletions(-) diff --git a/cr-dump.c b/cr-dump.c index 30b97b656..cea69f285 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -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; diff --git a/eventfd.c b/eventfd.c index e1b683903..170601628 100644 --- a/eventfd.c +++ b/eventfd.c @@ -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, }; diff --git a/eventpoll.c b/eventpoll.c index b0367f41a..1aaf1f47a 100644 --- a/eventpoll.c +++ b/eventpoll.c @@ -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, }; diff --git a/fifo.c b/fifo.c index 2de58b9e2..edc8a231a 100644 --- a/fifo.c +++ b/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 = { .type = FD_TYPES__FIFO, - .make_gen_id = make_gen_id, .dump = dump_one_fifo, }; diff --git a/files-reg.c b/files-reg.c index 49f5c09c0..30f717e8f 100644 --- a/files-reg.c +++ b/files-reg.c @@ -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, }; diff --git a/include/files.h b/include/files.h index 5178da3f7..8572766ef 100644 --- a/include/files.h +++ b/include/files.h @@ -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); diff --git a/inotify.c b/inotify.c index c4bae6c00..f119c766b 100644 --- a/inotify.c +++ b/inotify.c @@ -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, }; diff --git a/pipes.c b/pipes.c index d4b576c1a..86ec257e7 100644 --- a/pipes.c +++ b/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 = { .type = FD_TYPES__PIPE, - .make_gen_id = make_gen_id, .dump = dump_one_pipe, }; diff --git a/signalfd.c b/signalfd.c index e3b4d56bb..578fec0de 100644 --- a/signalfd.c +++ b/signalfd.c @@ -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, }; diff --git a/sk-inet.c b/sk-inet.c index 78b0c6fa5..d5266adba 100644 --- a/sk-inet.c +++ b/sk-inet.c @@ -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, }; diff --git a/sk-packet.c b/sk-packet.c index 73826e04c..66180695c 100644 --- a/sk-packet.c +++ b/sk-packet.c @@ -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, }; diff --git a/sk-unix.c b/sk-unix.c index 9bd5516d6..8950ba867 100644 --- a/sk-unix.c +++ b/sk-unix.c @@ -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, };