ceph: encode ctime in cap message
authorYan, Zheng <zyan@redhat.com>
Fri, 22 Jan 2016 10:30:12 +0000 (18:30 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 25 Mar 2016 17:51:40 +0000 (18:51 +0100)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/caps.c

index 6fe0ad26a7dfc0430da9e9e0fca8c312a4b2bdc0..de17bb232ff8d30906c53f34248ce99ea566562a 100644 (file)
@@ -991,7 +991,7 @@ static int send_cap_msg(struct ceph_mds_session *session,
                        u32 seq, u64 flush_tid, u64 oldest_flush_tid,
                        u32 issue_seq, u32 mseq, u64 size, u64 max_size,
                        struct timespec *mtime, struct timespec *atime,
-                       u64 time_warp_seq,
+                       struct timespec *ctime, u64 time_warp_seq,
                        kuid_t uid, kgid_t gid, umode_t mode,
                        u64 xattr_version,
                        struct ceph_buffer *xattrs_buf,
@@ -1042,6 +1042,8 @@ static int send_cap_msg(struct ceph_mds_session *session,
                ceph_encode_timespec(&fc->mtime, mtime);
        if (atime)
                ceph_encode_timespec(&fc->atime, atime);
+       if (ctime)
+               ceph_encode_timespec(&fc->ctime, ctime);
        fc->time_warp_seq = cpu_to_le32(time_warp_seq);
 
        fc->uid = cpu_to_le32(from_kuid(&init_user_ns, uid));
@@ -1116,7 +1118,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
        int held, revoking, dropping, keep;
        u64 seq, issue_seq, mseq, time_warp_seq, follows;
        u64 size, max_size;
-       struct timespec mtime, atime;
+       struct timespec mtime, atime, ctime;
        int wake = 0;
        umode_t mode;
        kuid_t uid;
@@ -1180,6 +1182,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
        ci->i_requested_max_size = max_size;
        mtime = inode->i_mtime;
        atime = inode->i_atime;
+       ctime = inode->i_ctime;
        time_warp_seq = ci->i_time_warp_seq;
        uid = inode->i_uid;
        gid = inode->i_gid;
@@ -1198,7 +1201,7 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
        ret = send_cap_msg(session, ceph_vino(inode).ino, cap_id,
                op, keep, want, flushing, seq,
                flush_tid, oldest_flush_tid, issue_seq, mseq,
-               size, max_size, &mtime, &atime, time_warp_seq,
+               size, max_size, &mtime, &atime, &ctime, time_warp_seq,
                uid, gid, mode, xattr_version, xattr_blob,
                follows, inline_data);
        if (ret < 0) {
@@ -1320,7 +1323,7 @@ retry:
                             capsnap->dirty, 0, capsnap->flush_tid, 0,
                             0, mseq, capsnap->size, 0,
                             &capsnap->mtime, &capsnap->atime,
-                            capsnap->time_warp_seq,
+                            &capsnap->ctime, capsnap->time_warp_seq,
                             capsnap->uid, capsnap->gid, capsnap->mode,
                             capsnap->xattr_version, capsnap->xattr_blob,
                             capsnap->follows, capsnap->inline_data);