[PATCH 1/2] ceph: update atime after read.

From: majianpeng
Date: Wed Jul 03 2013 - 01:35:12 EST


Now ceph don't update atime after read.So add this function.

Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
---
fs/ceph/file.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 656e169..fa74e6f 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -669,6 +669,15 @@ again:
out:
dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n",
inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret);
+
+ if (ret > 0) {
+ int dirty;
+ spin_lock(&ci->i_ceph_lock);
+ dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_RD);
+ spin_unlock(&ci->i_ceph_lock);
+ if (dirty)
+ __mark_inode_dirty(inode, dirty);
+ }
ceph_put_cap_refs(ci, got);

if (checkeof && ret >= 0) {
--
1.8.1.2
韬{.n?????%?lzwm?b?Р骒r?zXЩ??{ay????j?f"?????ア?⒎?:+v???????赙zZ+????"?!?O???v??m?鹈 n?帼Y&—