From de05b38e6a4d970c38127ba336be2c4b0b2a3ad0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 14 Sep 2016 13:32:34 -0400 Subject: [PATCH] include/fs_types: conditional denc_traits for inodeno_t Signed-off-by: Sage Weil --- src/include/fs_types.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/include/fs_types.h b/src/include/fs_types.h index c9271cca058..c5c4572a8f7 100644 --- a/src/include/fs_types.h +++ b/src/include/fs_types.h @@ -28,6 +28,22 @@ struct inodeno_t { } __attribute__ ((__may_alias__)); WRITE_CLASS_ENCODER(inodeno_t) +template<> +struct denc_traits { + 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; } -- 2.39.5