]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: make FixedKVNodeLayout::set_val() public
authorKefu Chai <kchai@redhat.com>
Fri, 19 Jun 2020 11:29:28 +0000 (19:29 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 3 Jul 2020 16:17:38 +0000 (00:17 +0800)
otherwise clang++ fails with
```
mson/os/seastore/lba_manager/btree/lba_btree_node_impl.cc:183:10: error: 'set_val' is a private member of 'crimson::common::FixedKVNodeLayout<255, unsigned long, ceph_le<unsigned long long>,
crimson::os::seastore::paddr_t, crimson::os::seastore::paddr_le_t, true>::iter_t<false>'
      i->set_val(updated);
         ^
/home/jenkins-build/build/workspace/ceph-perf-crimson/ceph-master/src/crimson/common/fixed_kv_node_layout.h:148:10: note: declared private here
    void set_val(V val) const {
         ^
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/common/fixed_kv_node_layout.h

index 422e47553586554be704bbf15b61177dd51701a6..4fda9dd93909c594e8a3cb4702b7b798995433c4 100644 (file)
@@ -125,6 +125,11 @@ public:
        return next->get_key();
     }
 
+    void set_val(V val) const {
+      static_assert(!is_const);
+      node->get_val_ptr()[offset] = VINT(val);
+    }
+
     V get_val() const {
       return V(node->get_val_ptr()[offset]);
     };
@@ -145,11 +150,6 @@ public:
       node->get_key_ptr()[offset] = lb;
     }
 
-    void set_val(V val) const {
-      static_assert(!is_const);
-      node->get_val_ptr()[offset] = VINT(val);
-    }
-
     typename maybe_const_t<char, is_const>::type get_key_ptr() const {
       return reinterpret_cast<
        typename maybe_const_t<char, is_const>::type>(
@@ -401,6 +401,15 @@ public:
     return *layout.template Pointer<0>(buf);
   }
 
+  /**
+   * set_size
+   *
+   * Set size representation to match size
+   */
+  void set_size(uint16_t size) {
+    *layout.template Pointer<0>(buf) = size;
+  }
+
   constexpr static size_t get_capacity() {
     return CAPACITY;
   }
@@ -604,16 +613,6 @@ private:
     return layout.template Pointer<2>(buf);
   }
 
-  /**
-   * set_size
-   *
-   * Set size representation to match size
-   */
-  void set_size(uint16_t size) {
-    *layout.template Pointer<0>(buf) = size;
-  }
-
-
   /**
    * copy_from_foreign
    *