commit a70e85cabd3ace420c94e4233f2dbbab5bb21bc1
Author: Erez_Zadok <[EMAIL PROTECTED]>
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 63f6a7b..9f61ded 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);
@@ -55,12 +52,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));
return err;
}
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
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs