]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
include/fs_types: conditional denc_traits for inodeno_t
authorSage Weil <sage@redhat.com>
Wed, 14 Sep 2016 17:32:34 +0000 (13:32 -0400)
committerSage Weil <sage@redhat.com>
Sun, 16 Oct 2016 14:32:50 +0000 (10:32 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/include/fs_types.h

index c9271cca05893907b4bf43c762af10f6a3d4e62f..c5c4572a8f75b3b82f5b5bfc66869e32c413023f 100644 (file)
@@ -28,6 +28,22 @@ struct inodeno_t {
 } __attribute__ ((__may_alias__));
 WRITE_CLASS_ENCODER(inodeno_t)
 
+template<>
+struct denc_traits<inodeno_t> {
+  enum { supported = 2 };
+  enum { featured = false };
+  enum { bounded = true };
+  static void bound_encode(const inodeno_t o, size_t& p) {
+    denc(o.val, p);
+  }
+  static void encode(const inodeno_t &o, buffer::list::contiguous_appender& p) {
+    denc(o.val, p);
+  }
+  static void decode(inodeno_t& o, buffer::ptr::iterator &p) {
+    denc(o.val, p);
+  }
+};
+
 inline ostream& operator<<(ostream& out, inodeno_t ino) {
   return out << hex << ino.val << dec;
 }