mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 15:25:21 +00:00
fsnotify: Move decoding handle into function
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
21
fsnotify.c
21
fsnotify.c
@@ -175,6 +175,18 @@ const struct fdtype_ops fanotify_dump_ops = {
|
|||||||
.dump = dump_one_fanotify,
|
.dump = dump_one_fanotify,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void decode_handle(fh_t *handle, FhEntry *img)
|
||||||
|
{
|
||||||
|
memzero(handle, sizeof(*handle));
|
||||||
|
|
||||||
|
handle->type = img->type;
|
||||||
|
handle->bytes = img->bytes;
|
||||||
|
|
||||||
|
memcpy(handle->__handle, img->handle,
|
||||||
|
min(pb_repeated_size(img, handle),
|
||||||
|
sizeof(handle->__handle)));
|
||||||
|
}
|
||||||
|
|
||||||
static char *get_mark_path(const char *who, struct file_remap *remap,
|
static char *get_mark_path(const char *who, struct file_remap *remap,
|
||||||
FhEntry *f_handle, unsigned long i_ino,
|
FhEntry *f_handle, unsigned long i_ino,
|
||||||
unsigned int s_dev, char *buf, size_t size,
|
unsigned int s_dev, char *buf, size_t size,
|
||||||
@@ -190,14 +202,7 @@ static char *get_mark_path(const char *who, struct file_remap *remap,
|
|||||||
return remap->path;
|
return remap->path;
|
||||||
}
|
}
|
||||||
|
|
||||||
memzero(&handle, sizeof(handle));
|
decode_handle(&handle, f_handle);
|
||||||
|
|
||||||
handle.type = f_handle->type;
|
|
||||||
handle.bytes = f_handle->bytes;
|
|
||||||
|
|
||||||
memcpy(handle.__handle, f_handle->handle,
|
|
||||||
min(pb_repeated_size(f_handle, handle),
|
|
||||||
sizeof(handle.__handle)));
|
|
||||||
|
|
||||||
mntfd = open_mount(s_dev);
|
mntfd = open_mount(s_dev);
|
||||||
if (mntfd < 0) {
|
if (mntfd < 0) {
|
||||||
|
Reference in New Issue
Block a user