GIT: unionfs2-2.6.27.y: mmap: file revalidation

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:16:19 EDT 2010


commit dc82aa997d78186d864509101e808b0f07f77003
Author: Yiannis Pericleous <yiannos at louie.fsl.cs.sunysb.edu>
Date:   Fri Apr 27 18:13:29 2007 -0400

    mmap: file revalidation

diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c
index 57792d5..7d27bd8 100644
--- a/fs/unionfs/mmap.c
+++ b/fs/unionfs/mmap.c
@@ -162,6 +162,9 @@ int unionfs_readpage(struct file *file, struct page *page)
 {
 	int err;
 
+	if ((err = unionfs_file_revalidate(file, 0)))
+		goto out_err;
+
 	err = unionfs_do_readpage(file, page);
 
 	/*
@@ -170,6 +173,7 @@ int unionfs_readpage(struct file *file, struct page *page)
 	 * it
 	 */
 
+out_err:
 	unlock_page(page);
 
 	return err;
@@ -178,7 +182,7 @@ int unionfs_readpage(struct file *file, struct page *page)
 int unionfs_prepare_write(struct file *file, struct page *page, unsigned from,
 			  unsigned to)
 {
-	return 0;
+	return unionfs_file_revalidate(file, 1);
 }
 
 int unionfs_commit_write(struct file *file, struct page *page, unsigned from,
@@ -194,6 +198,9 @@ int unionfs_commit_write(struct file *file, struct page *page, unsigned from,
 
 	BUG_ON(file == NULL);
 
+	if ((err = unionfs_file_revalidate(file, 1)))
+		goto out;
+
 	inode = page->mapping->host;	/* CPW: Moved below print_entry_location */
 	lower_inode = unionfs_lower_inode(inode);
 


More information about the unionfs-cvs mailing list