2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

files: Compact the code by removing per-file dump helpers

Since *all* of them just call do_dump_gen_file with proper ops,
just call one directly. Compacts the code.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2013-06-14 00:11:08 +04:00
parent 42f77676b6
commit d020ebb36d
26 changed files with 65 additions and 126 deletions

View File

@@ -125,16 +125,11 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
return parse_fdinfo(lfd, FD_TYPES__INOTIFY, dump_inotify_entry, &id);
}
static const struct fdtype_ops inotify_ops = {
const struct fdtype_ops inotify_dump_ops = {
.type = FD_TYPES__INOTIFY,
.dump = dump_one_inotify,
};
int dump_inotify(struct fd_parms *p, int lfd, const int fdinfo)
{
return do_dump_gen_file(p, lfd, &inotify_ops, fdinfo);
}
static int dump_fanotify_entry(union fdinfo_entries *e, void *arg)
{
struct fsnotify_params *fsn_params = arg;
@@ -195,16 +190,11 @@ static int dump_one_fanotify(int lfd, u32 id, const struct fd_parms *p)
return pb_write_one(fdset_fd(glob_fdset, CR_FD_FANOTIFY), &fe, PB_FANOTIFY);
}
static const struct fdtype_ops fanotify_ops = {
const struct fdtype_ops fanotify_dump_ops = {
.type = FD_TYPES__FANOTIFY,
.dump = dump_one_fanotify,
};
int dump_fanotify(struct fd_parms *p, int lfd, const int fdinfo)
{
return do_dump_gen_file(p, lfd, &fanotify_ops, fdinfo);
}
static char *get_mark_path(const char *who, struct file_remap *remap,
FhEntry *f_handle, unsigned long i_ino,
unsigned int s_dev, char *buf, size_t size,