diff options
author | Pavel Emelyanov <xemul@virtuozzo.com> | 2017-06-22 20:40:19 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@virtuozzo.com> | 2017-07-18 09:34:45 +0300 |
commit | c14cede697a72464f1eb70768c3a9e9ecc3a56a4 (patch) | |
tree | 776583750cf76b0e30d8d5328a3a45762adbaecf /criu/timerfd.c | |
parent | e5b4ef20fc1258751ad53cf9215c82e9839c2108 (diff) |
timerfd: Rework parse_fdinfo not to use callback
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'criu/timerfd.c')
-rw-r--r-- | criu/timerfd.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/criu/timerfd.c b/criu/timerfd.c index 476bf602e..60f77fc5d 100644 --- a/criu/timerfd.c +++ b/criu/timerfd.c @@ -64,26 +64,21 @@ int is_timerfd_link(char *link) return is_anon_link_type(link, "[timerfd]"); } -static int dump_timerfd_entry(union fdinfo_entries *e, void *arg) +static int dump_one_timerfd(int lfd, u32 id, const struct fd_parms *p) { - struct timerfd_dump_arg *da = arg; - TimerfdEntry *tfy = &e->tfy; + TimerfdEntry tfe = TIMERFD_ENTRY__INIT; - tfy->id = da->id; - tfy->flags = da->p->flags; - tfy->fown = (FownEntry *)&da->p->fown; + if (parse_fdinfo(lfd, FD_TYPES__TIMERFD, NULL, &tfe)) + return -1; + tfe.id = id; + tfe.flags = p->flags; + tfe.fown = (FownEntry *)&p->fown; pr_info("Dumping id %#x clockid %d it_value(%llu, %llu) it_interval(%llu, %llu)\n", - tfy->id, tfy->clockid, (unsigned long long)tfy->vsec, (unsigned long long)tfy->vnsec, - (unsigned long long)tfy->isec, (unsigned long long)tfy->insec); - - return pb_write_one(img_from_set(glob_imgset, CR_FD_TIMERFD), &e->tfy, PB_TIMERFD); -} + tfe.id, tfe.clockid, (unsigned long long)tfe.vsec, (unsigned long long)tfe.vnsec, + (unsigned long long)tfe.isec, (unsigned long long)tfe.insec); -static int dump_one_timerfd(int lfd, u32 id, const struct fd_parms *p) -{ - struct timerfd_dump_arg da = { .id = id, .p = p, }; - return parse_fdinfo(lfd, FD_TYPES__TIMERFD, dump_timerfd_entry, &da); + return pb_write_one(img_from_set(glob_imgset, CR_FD_TIMERFD), &tfe, PB_TIMERFD); } const struct fdtype_ops timerfd_dump_ops = { |