]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: conditionally include flock metadata in MClientCaps
authorSage Weil <sage@newdream.net>
Tue, 11 May 2010 20:31:37 +0000 (13:31 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Mon, 2 Aug 2010 17:39:54 +0000 (10:39 -0700)
src/messages/MClientCaps.h

index db46dfe0af97f3bc1511285d121312401ef1fe3f..9e5ef38de07a5251d47d3a60cd0c2027618ffd13 100644 (file)
@@ -23,6 +23,7 @@ class MClientCaps : public Message {
   struct ceph_mds_caps head;
   bufferlist snapbl;
   bufferlist xattrbl;
+  bufferlist flockbl;
 
   int      get_caps() { return head.caps; }
   int      get_wanted() { return head.wanted; }
@@ -138,6 +139,10 @@ public:
     assert(middle.length() == head.xattr_len);
     if (head.xattr_len)
       xattrbl = middle;
+
+    // conditionally decode flock metadata
+    if (header.version >= 2)
+      ::decode(flockbl, p);
   }
   void encode_payload() {
     head.snap_trace_len = snapbl.length();
@@ -146,6 +151,12 @@ public:
     ::encode_nohead(snapbl, payload);
 
     middle = xattrbl;
+
+    // conditionally include flock metadata
+    if (connection->has_feature(CEPH_FEATURE_FLOCK)) {
+      header.version = 2;
+      ::encode(flockbl, payload);
+    }
   }
 };