]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/crimson/os/seastore/onode.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / crimson / os / seastore / onode.cc
index a8b925b7014884cd657c69485ba6a9a399949298..96b69fb7c30f1df1973192e5762090add7a24b8c 100644 (file)
@@ -1,43 +1,17 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
 // vim: ts=8 sw=2 smarttab
 
 #include "onode.h"
-#include "include/encoding.h"
+#include <iostream>
 
 namespace crimson::os::seastore {
 
-size_t Onode::size() const
-{
-  return ceph::encoded_sizeof(*this);
-}
-
-void Onode::encode(void* buffer, size_t len)
-{
-  struct [[gnu::packed]] encoded_t {
-    uint8_t struct_v;
-    uint8_t struct_compat;
-    uint32_t struct_len;
-    uint32_t len;
-    char data[];
-  };
-  auto p = reinterpret_cast<encoded_t*>(buffer);
-  assert(std::numeric_limits<uint16_t>::max() >= size());
-  assert(len >= size());
-  p->struct_v = 1;
-  p->struct_compat = 1;
-  p->struct_len = sizeof(encoded_t) + payload.size();
-  p->len = payload.size();
-  std::memcpy(p->data, payload.data(), payload.size());
-}
-
-bool operator==(const Onode& lhs, const Onode& rhs)
-{
-  return lhs.get() == rhs.get();
-}
-
 std::ostream& operator<<(std::ostream &out, const Onode &rhs)
 {
-  return out << rhs.get();
+  auto &layout = rhs.get_layout();
+  return out << "Onode("
+             << "size=" << static_cast<uint32_t>(layout.size)
+             << ")";
 }
 
 }