All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ceph:Update the file time after mmap-write.
@ 2013-07-11  1:17 majianpeng
  2013-07-11  1:42 ` Yan, Zheng
  0 siblings, 1 reply; 8+ messages in thread
From: majianpeng @ 2013-07-11  1:17 UTC (permalink / raw)
  To: sage; +Cc: ceph-devel

Although, mmap-write of ceph update the time of file using
file_update_time.Because it don't mark the relative cap so the time
can't save.

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

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 38b5c1b..52f7c7c 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1231,10 +1231,18 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
 
 	ret = ceph_update_writeable_page(vma->vm_file, off, len, page);
 	if (ret == 0) {
+		int dirty;
+		struct ceph_inode_info *ci = ceph_inode(inode);
 		/* success.  we'll keep the page locked. */
 		set_page_dirty(page);
 		up_read(&mdsc->snap_rwsem);
 		ret = VM_FAULT_LOCKED;
+
+		spin_lock(&ci->i_ceph_lock);
+		dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
+		spin_unlock(&ci->i_ceph_lock);
+		if (dirty)
+		       	__mark_inode_dirty(inode, dirty);
 	} else {
 		if (ret == -ENOMEM)
 			ret = VM_FAULT_OOM;
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-12  3:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-11  1:17 [PATCH] ceph:Update the file time after mmap-write majianpeng
2013-07-11  1:42 ` Yan, Zheng
2013-07-11  1:49   ` majianpeng
2013-07-11  7:53   ` majianpeng
2013-07-11  9:03     ` Yan, Zheng
2013-07-12  2:26       ` majianpeng
2013-07-12  2:46       ` Gregory Farnum
2013-07-12  3:16         ` Yan, Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.