[PATCH] ceph:Update the file time after mmap-write.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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
?韬{.n?????%??檩??w?{.n????u朕?Ф?塄}?财??j:+v??????2??璀??摺?囤??z夸z罐?+?????w棹f





[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux