Skip to contentSkip to conversation

cr: ext4: use filemap_checkpoint for ext4 file backed mmaps

PATCH In review Serge E. Hallyn 2 participants 2 messages Sep 11, 2009 – Sep 14, 2009 1 message not in the archive

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

PATCH 1/1 cr: ext4: use filemap_checkpoint for ext4 file backed mmaps

I don't know if this is "the right thing" to do, or if there will be special ext4 cases which this doesn't handle, but all of my cr_tests pass with this patch applied on F11 with an ext4 rootfs (and fail without on trying to checkpoint a library on ext4fs bc it has its own vm_ops but no vm_ops->checkpoint()).

---
 fs/ext4/file.c     |    3 +++
 include/linux/mm.h |    1 +
 mm/filemap.c       |    2 +-
 3 files changed, 5 insertions(+), 1 deletions(-)
fs/ext4/file.c +3 -0
index a99bcc3..cdac137 100644
@@ -133,6 +133,9 @@ force_commit:
 static struct vm_operations_struct ext4_file_vm_ops = {
 	.fault		= filemap_fault,
 	.page_mkwrite   = ext4_page_mkwrite,
+#ifdef CONFIG_CHECKPOINT
+	.checkpoint	= filemap_checkpoint,
+#endif
 };
 
 static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
include/linux/mm.h +1 -0
index 5f341ac..5b9b217 100644
@@ -1185,6 +1185,7 @@ extern void truncate_inode_pages_range(struct address_space *,
 
 /* generic vm_area_ops exported for stackable file systems */
 extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
+extern int filemap_checkpoint(struct ckpt_ctx *ctx, struct vm_area_struct *vma);
 
 /* mm/page-writeback.c */
 int write_one_page(struct page *page, int wait);
mm/filemap.c +1 -1
index 0c4906f..eb7653d 100644
@@ -1650,7 +1650,7 @@ page_not_uptodate:
 EXPORT_SYMBOL(filemap_fault);
 
 #ifdef CONFIG_CHECKPOINT
-static int filemap_checkpoint(struct ckpt_ctx *ctx, struct vm_area_struct *vma)
+int filemap_checkpoint(struct ckpt_ctx *ctx, struct vm_area_struct *vma)
 {
 	struct file *file = vma->vm_file;
 	int vma_objref;
Signature · 1 line
1.6.2.5

A message that is not in the archive (sent off-list or not yet received): 20090911212008.GA15329-r/[email protected]

#2 lore raw

queued for ckpt-v18.

Quoted 53 lines · Serge E. Hallyn

I don't know if this is "the right thing" to do, or if there will be special ext4 cases which this doesn't handle, but all of my cr_tests pass with this patch applied on F11 with an ext4 rootfs (and fail without on trying to checkpoint a library on ext4fs bc it has its own vm_ops but no vm_ops->checkpoint()).

---
 fs/ext4/file.c     |    3 +++
 include/linux/mm.h |    1 +
 mm/filemap.c       |    2 +-
 3 files changed, 5 insertions(+), 1 deletions(-)
fs/ext4/file.c +3 -0
index a99bcc3..cdac137 100644
@@ -133,6 +133,9 @@ force_commit:
 static struct vm_operations_struct ext4_file_vm_ops = {
 	.fault		= filemap_fault,
 	.page_mkwrite   = ext4_page_mkwrite,
+#ifdef CONFIG_CHECKPOINT
+	.checkpoint	= filemap_checkpoint,
+#endif
 };
 
 static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
include/linux/mm.h +1 -0
index 5f341ac..5b9b217 100644
@@ -1185,6 +1185,7 @@ extern void truncate_inode_pages_range(struct address_space *,
 
 /* generic vm_area_ops exported for stackable file systems */
 extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
+extern int filemap_checkpoint(struct ckpt_ctx *ctx, struct vm_area_struct *vma);
 
 /* mm/page-writeback.c */
 int write_one_page(struct page *page, int wait);
mm/filemap.c +1 -1
index 0c4906f..eb7653d 100644
@@ -1650,7 +1650,7 @@ page_not_uptodate:
 EXPORT_SYMBOL(filemap_fault);
 
 #ifdef CONFIG_CHECKPOINT
-static int filemap_checkpoint(struct ckpt_ctx *ctx, struct vm_area_struct *vma)
+int filemap_checkpoint(struct ckpt_ctx *ctx, struct vm_area_struct *vma)
 {
 	struct file *file = vma->vm_file;
 	int vma_objref;