diff options
author | Sage Weil <sage@inktank.com> | 2013-09-16 22:49:44 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-17 06:27:34 -0700 |
commit | 0ea16cc6de18578a15fd8efa3f3bd709f59b2456 (patch) | |
tree | e713d74fc9b3df41fadcc66f96a31bfc0a55a719 | |
parent | 805f95b3cff1c1cc97e214139f6738c70485944c (diff) | |
download | ceph-0ea16cc6de18578a15fd8efa3f3bd709f59b2456.tar.gz |
messages/MClient{Request,Reply}: add inline data fields
-rw-r--r-- | src/messages/MClientCaps.h | 18 | ||||
-rw-r--r-- | src/messages/MClientReply.h | 9 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/messages/MClientCaps.h b/src/messages/MClientCaps.h index 117f24162e7..260d7147075 100644 --- a/src/messages/MClientCaps.h +++ b/src/messages/MClientCaps.h @@ -21,7 +21,7 @@ class MClientCaps : public Message { - static const int HEAD_VERSION = 2; // added flock metadata + static const int HEAD_VERSION = 3; // added flock metadata, inline data static const int COMPAT_VERSION = 1; public: @@ -29,6 +29,8 @@ class MClientCaps : public Message { bufferlist snapbl; bufferlist xattrbl; bufferlist flockbl; + uint64_t inline_version; + bufferlist inline_data; int get_caps() { return head.caps; } int get_wanted() { return head.wanted; } @@ -148,6 +150,13 @@ public: if (head.xattr_len) xattrbl = middle; + if (header.version >= 3) { + ::decode(inline_version, p); + ::decode(inline_data, p); + } else { + inline_version = CEPH_INLINE_DISABLED; + } + // conditionally decode flock metadata if (header.version >= 2) ::decode(flockbl, p); @@ -160,6 +169,13 @@ public: middle = xattrbl; + if (features & CEPH_FEATURE_MDS_INLINE_DATA) { + ::encode(inline_version, payload); + ::encode(inline_data, payload); + } else { + header.version = 2; + } + // conditionally include flock metadata if (features & CEPH_FEATURE_FLOCK) { ::encode(flockbl, payload); diff --git a/src/messages/MClientReply.h b/src/messages/MClientReply.h index 896245f34b8..a8e83c29894 100644 --- a/src/messages/MClientReply.h +++ b/src/messages/MClientReply.h @@ -108,6 +108,8 @@ struct InodeStat { uint64_t truncate_size; utime_t ctime, mtime, atime; version_t time_warp_seq; + bufferlist inline_data; + uint64_t inline_version; frag_info_t dirstat; nest_info_t rstat; @@ -174,6 +176,13 @@ struct InodeStat { xattr_version = e.xattr_version; ::decode(xattrbl, p); + + if (features & CEPH_FEATURE_MDS_INLINE_DATA) { + ::decode(inline_version, p); + ::decode(inline_data, p); + } else { + inline_version = CEPH_INLINE_DISABLED; + } } // see CInode::encode_inodestat for encoder. |