Skip to contentSkip to conversation

checkpoint header fixes, cleanups

PATCH In review Nathan Lynch 2 participants 6 messages Jun 22, 2009 – Jun 24, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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(-)

A message that is not in the archive (sent off-list or not yet received): 1245711978-1453-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH 1/4 shm.h: add checkpoint-related declarations

shm.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
index 6edc26e..94ac1a7 100644
@@ -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
#3 lore raw

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
index e64f892..18e462c 100644
@@ -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
#4 lore raw

PATCH 3/4 pipe_fs_i.h: add checkpoint-related declarations

In reply to a message not in the archive

pipe_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
index b877598..fe45a85 100644
@@ -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
#5 lore raw

PATCH 4/4 remove checkpoint_types.h dependency from mm.h

In reply to a message not in the archive

The 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
index c8e8972..fa89212 100644
@@ -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
#6 lore raw
In reply to a message not in the archive

These definitely make sense. Applied.

Thanks,

Oren.

Quoted 17 lines · Nathan Lynch

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(-)

_______________________________________________
Containers mailing list Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers