* [PATCH 1/2] ceph: update atime after read.
@ 2013-07-03 5:34 majianpeng
0 siblings, 0 replies; only message in thread
From: majianpeng @ 2013-07-03 5:34 UTC (permalink / raw)
To: sage; +Cc: ceph-devel, linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 906 bytes --]
Now ceph don't update atime after read.So add this function.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
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Ç+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-07-03 5:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03 5:34 [PATCH 1/2] ceph: update atime after read majianpeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox