Skip to contentSkip to conversation

Fix compile failures when CONFIG_CHECKPOINT=n

PATCH New Matt Helsley 1 participant 1 message Apr 30, 2009

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

PATCH 1/1 Fix compile failures when CONFIG_CHECKPOINT=n

Fix compile failures when CONFIG_CHECKPOINT=n

These structure members are only defined if CONFIG_CHECKPOINT=y. Ensure that we can always build by protecting them with #ifdef CONFIG_CHECKPOINT. Would be nice to avoid the #ifdefferry but I don't see a better way to do it...

---

ipc/shm.c +3 -1
index 70e0651..da27d92 100644
@@ -376,7 +376,7 @@ int ipcshm_restore(struct ckpt_ctx *ctx, struct mm_struct *mm,
 	return ret;
 }
 #else
-define ipcshm_checkpoint NULL
+#define ipcshm_checkpoint NULL
 #endif
 
 static const struct file_operations shm_file_operations = {
@@ -394,7 +394,9 @@ static struct vm_operations_struct shm_vm_ops = {
 	.set_policy = shm_set_policy,
 	.get_policy = shm_get_policy,
 #endif
+#ifdef CONFIG_CHECKPOINT
 	.checkpoint = ipcshm_checkpoint,
+#endif
 };
 
 /**
mm/filemap.c +2 -0
index af83da7..93aa64b 100644
@@ -1716,7 +1716,9 @@ int filemap_restore(struct ckpt_ctx *ctx,
 
 struct vm_operations_struct generic_file_vm_ops = {
 	.fault		= filemap_fault,
+#ifdef CONFIG_CHECKPOINT
 	.checkpoint	= filemap_checkpoint,
+#endif /* CONFIG_CHECKPOINT */
 };
 
 /* This is used for a general mmap of a disk file */
mm/mmap.c +2 -0
index 555a6a3..ef7c9e0 100644
@@ -2322,7 +2322,9 @@ int special_mapping_restore(struct ckpt_ctx *ctx,
 static struct vm_operations_struct special_mapping_vmops = {
 	.close = special_mapping_close,
 	.fault = special_mapping_fault,
+#ifdef CONFIG_CHECKPOINT
 	.checkpoint = special_mapping_checkpoint,
+#endif
 };
 
 /*