GIT: unionfs2-2.6.27.y: mmap: update atime upon successful file reading (via mmap or otherwise)

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


commit 0158b325057bfa581a60deb4352b2147bfba1368
Author: Erez_Zadok <ezk at cs.sunysb.edu>
Date:   Sat May 5 20:41:46 2007 -0400

    mmap: update atime upon successful file reading (via mmap or otherwise)

diff --git a/fs/unionfs/file.c b/fs/unionfs/file.c
index c4deba6..1c20844 100644
--- a/fs/unionfs/file.c
+++ b/fs/unionfs/file.c
@@ -33,12 +33,9 @@ static ssize_t unionfs_read(struct file *file, char __user *buf,
 
 	err = do_sync_read(file, buf, count, ppos);
 
-#if 0
-	FIXME: do_sync_read updates a time
 	if (err >= 0)
 		touch_atime(unionfs_lower_mnt(file->f_path.dentry),
-				unionfs_lower_dentry(file->f_path.dentry));
-#endif
+			    unionfs_lower_dentry(file->f_path.dentry));
 
 out:
 	unionfs_read_unlock(file->f_dentry->d_sb);
@@ -56,12 +53,9 @@ static ssize_t unionfs_aio_read(struct kiocb *iocb, const struct iovec *iov,
 	if (err == -EIOCBQUEUED)
 		err = wait_on_sync_kiocb(iocb);
 
-#if 0
-	XXX: is this needed?
 	if (err >= 0)
 		touch_atime(unionfs_lower_mnt(iocb->ki_filp->f_path.dentry),
-				unionfs_lower_dentry(iocb->ki_filp->f_path.dentry));
-#endif
+			    unionfs_lower_dentry(iocb->ki_filp->f_path.dentry));
 
 #if 0
 out:
diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c
index ade8c92..7d1e2f7 100644
--- a/fs/unionfs/mmap.c
+++ b/fs/unionfs/mmap.c
@@ -168,6 +168,10 @@ int unionfs_readpage(struct file *file, struct page *page)
 
 	err = unionfs_do_readpage(file, page);
 
+	if (!err)
+		touch_atime(unionfs_lower_mnt(file->f_path.dentry),
+			    unionfs_lower_dentry(file->f_path.dentry));
+
 	/*
 	 * we have to unlock our page, b/c we _might_ have gotten a locked
 	 * page.  but we no longer have to wakeup on our page here, b/c


More information about the unionfs-cvs mailing list