]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add safe flag to mds reply
authorSage Weil <sage@newdream.net>
Mon, 22 Dec 2008 21:42:12 +0000 (13:42 -0800)
committerSage Weil <sage@newdream.net>
Tue, 23 Dec 2008 19:45:22 +0000 (11:45 -0800)
src/include/ceph_fs.h
src/messages/MClientReply.h
src/messages/MClientRequest.h

index 1dc1ad14b5664fc666c9fbb72a3b26d8b6847eab..16051c5d7aebab2ef5bd0b6d49dbadfa16ac7c6d 100644 (file)
@@ -823,6 +823,7 @@ struct ceph_mds_reply_head {
        __le32 file_caps_seq;
        __le32 file_caps_mseq;
        __le32 mdsmap_epoch;
+       __u8 safe;
 } __attribute__ ((packed));
 
 /* one for each node split */
index c31998ee923ddb22135c5343e26eaf63cf335932..e50a0855140c0fdf37cd8a6f0b3e152fc16d857f 100644 (file)
@@ -194,9 +194,10 @@ public:
   MClientReply(MClientRequest *req, int result = 0) : 
     Message(CEPH_MSG_CLIENT_REPLY) {
     memset(&st, 0, sizeof(st));
-    this->st.tid = req->get_tid();
-    this->st.op = req->get_op();
-    this->st.result = result;
+    st.tid = req->get_tid();
+    st.op = req->get_op();
+    st.result = result;
+    st.safe = 1;
   }
   const char *get_type_name() { return "creply"; }
   void print(ostream& o) {
@@ -204,6 +205,8 @@ public:
     o << " = " << get_result();
     if (get_result() <= 0)
       o << " " << strerror(-get_result());
+    if (st.safe)
+      o << " safe";
     o << ")";
   }
 
index 0425d9892f9a781961df65ce60aeab8ac21df80e..304a4701f1305666270b295fbd670cc6b047a150 100644 (file)
@@ -63,7 +63,7 @@ public:
   MClientRequest() : Message(CEPH_MSG_CLIENT_REQUEST) {}
   MClientRequest(int op) : Message(CEPH_MSG_CLIENT_REQUEST) {
     memset(&head, 0, sizeof(head));
-    this->head.op = op;
+    head.op = op;
   }
 
   void set_mdsmap_epoch(epoch_t e) { head.mdsmap_epoch = e; }