checkpoint header fixes, cleanups
cover checkpoint header fixes, cleanups
Nathan Lynch (4):
shm.h: add checkpoint-related declarations fs.h: fix header export breakage pipe_fs_i.h: add checkpoint-related declarations remove checkpoint_types.h dependency from mm.h
include/linux/fs.h | 2 +- include/linux/mm.h | 4 ++-- include/linux/pipe_fs_i.h | 2 ++ include/linux/shm.h | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-)
PATCH 1/4 shm.h: add checkpoint-related declarations
In reply to a message not in the archiveshm.h apparently relies on ordering of includes in .c files to get declarations of ckpt_ctx and ckpt_hdr_vma for ipcshm_restore's prototype. This is bad. Add appropriate forward declarations.
--- include/linux/shm.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/shm.h +2 -0
@@ -124,6 +124,8 @@ extern int shmctl_down(struct ipc_namespace *ns, int shmid, int cmd,#ifdef CONFIG_CHECKPOINT #ifdef CONFIG_SYSVIPC +struct ckpt_ctx ; +struct ckpt_hdr_vma ;extern int ipcshm_restore (struct ckpt_ctx *ctx,struct mm_struct *mm,struct ckpt_hdr_vma *h);#else
Signature · 1 line
1.6.0.6
PATCH 2/4 fs.h: fix header export breakage
In reply to a message not in the archive# make headers_check ... /home/nathanl/devel/linux-2.6.git/usr/include/linux/fs.h:11: included file 'linux/checkpoint_types.h' is not exported
This breaks building of any user space code which includes fs.h.
include/linux/checkpoint_types.h is not exported. include/linux/fs.h is exported.
The latter #includes the former for the declaration of struct ckpt_ctx, but this is not strictly necessary for correctness. Forward-declaring struct ckpt_ctx and removing the include of checkpoint_types.h is sufficient and fixes the breakage.
--- include/linux/fs.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/fs.h +1 -1
@@ -8,7 +8,6 @@#include <linux/limits.h> #include <linux/ioctl.h> -#include <linux/checkpoint_types.h> /* * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -389,6 +388,7 @@ struct kstatfs;struct vm_area_struct ;struct vfsmount ;struct cred ; +struct ckpt_ctx ;extern void __init inode_init (void );extern void __init inode_init_early (void );
Signature · 1 line
1.6.0.6
PATCH 3/4 pipe_fs_i.h: add checkpoint-related declarations
In reply to a message not in the archivepipe_fs_i.h apparently relies on ordering of includes in .c files to get declarations of ckpt_ctx and ckpt_hdr_file for pipe_file_restore's prototype. This is bad. Add appropriate forward declarations.
--- include/linux/pipe_fs_i.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/pipe_fs_i.h +2 -0
@@ -155,6 +155,8 @@ int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);/* checkpoint/restart */ #ifdef CONFIG_CHECKPOINT +struct ckpt_ctx ; +struct ckpt_hdr_file ;extern struct file *pipe_file_restore (struct ckpt_ctx *ctx,struct ckpt_hdr_file *ptr);#endif
Signature · 1 line
1.6.0.6
PATCH 4/4 remove checkpoint_types.h dependency from mm.h
In reply to a message not in the archiveThe checkpoint-related declarations in mm.h don't require the definitions of struct ckpt_ctx and ckpt_hdr_vma; simply forward declare these and remove the include of checkpoint_types.h.
--- include/linux/mm.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/mm.h +2 -2
@@ -14,13 +14,12 @@#include <linux/debug_locks.h> #include <linux/mm_types.h> -#include <linux/checkpoint_types.h> -struct mempolicy ;struct anon_vma ;struct file_ra_state ;struct user_struct ;struct writeback_control ; +struct ckpt_ctx ;#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ extern unsigned long max_mapnr;
@@ -1199,6 +1198,7 @@ void task_dirty_inc(struct task_struct *tsk);/* checkpoint/restart */ #ifdef CONFIG_CHECKPOINT +struct ckpt_hdr_vma ;extern int filemap_restore (struct ckpt_ctx *ctx,struct mm_struct *mm,struct ckpt_hdr_vma *hh); extern int special_mapping_restore(struct ckpt_ctx *ctx, struct mm_struct *mm,
Signature · 1 line
1.6.0.6
These definitely make sense. Applied.
Thanks,
Oren.
Quoted 17 lines · Nathan Lynch
Nathan Lynch (4):
shm.h: add checkpoint-related declarationsfs.h: fix header export breakagepipe_fs_i.h: add checkpoint-related declarations removecheckpoint_types.hdependency frommm.hinclude/linux/fs.h | 2 +- include/linux/mm.h | 4 ++-- include/linux/pipe_fs_i.h | 2 ++ include/linux/shm.h | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-)_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers