c/r: checkpoint and restore FIFOs
PATCH 1/1 c/r: checkpoint and restore FIFOs
FIFOs are almost like pipes.
Checkpoints adds the FIFO pathname. The first time the FIFO is found it also assigns an @objref and dumps the contents in the buffers.
To restore, use the @objref only to determine whether a particular FIFO has already been restored earlier. Note that it ignores the file pointer that matches that @objref (unlike with pipes, where that file corresponds to the other end of the pipe). Instead, it creates a new FIFO using the saved pathname.
Signed-off-by Oren Laadan <[email protected]>
--- checkpoint/files.c | 6 +++ fs/pipe.c | 82 +++++++++++++++++++++++++++++++++++++++- include/linux/checkpoint_hdr.h | 1 + include/linux/pipe_fs_i.h | 2 + 4 files changed, 89 insertions(+), 2 deletions(-)
checkpoint/files.c +6 -0
@@ -548,6 +548,12 @@ static struct restore_file_ops restore_file_ops[] = { .file_type = CKPT_FILE_PIPE, .restore = pipe_file_restore, }, +/* fifo */ + { + .file_name = "FIFO", + .file_type = CKPT_FILE_FIFO, + .restore = fifo_file_restore, + }, };static struct file *do_restore_file (struct ckpt_ctx *ctx)
fs/pipe.c +80 -2
114 lines not on this page · raw message
include/linux/checkpoint_hdr.h +1 -0
@@ -326,6 +326,7 @@ enum file_type {CKPT_FILE_IGNORE =0 ,CKPT_FILE_GENERIC ,CKPT_FILE_PIPE , +CKPT_FILE_FIFO , CKPT_FILE_MAX };
include/linux/pipe_fs_i.h +2 -0
@@ -160,6 +160,8 @@ struct ckpt_ctx;struct ckpt_hdr_file ;extern struct file *pipe_file_restore (struct ckpt_ctx *ctx,struct ckpt_hdr_file *ptr); +extern struct file *fifo_file_restore (struct ckpt_ctx *ctx, +struct ckpt_hdr_file *ptr);#endif #endif
Signature · 1 line
1.6.0.4