crimson/os: cast pointers to void* before printing them

to address the FTBFS like:

../src/crimson/os/seastore/lba_manager/btree/btree_range_pin.cc:110:14:   required from here
/usr/include/fmt/core.h:902:19: error: static assertion failed: formatting of non-void pointers is disallowed
  902 |     static_assert(!sizeof(T), "formatting of non-void pointers is disallowed");
      |                   ^~~~~~~~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2020-09-09 11:26:58 +08:00
parent ebfed2b1ac
commit 2fa982eabc
2 changed files with 5 additions and 3 deletions

View File

@ -102,10 +102,12 @@ void btree_pin_set_t::add_pin(btree_range_pin_t &pin)
auto *parent = maybe_get_parent(pin.range);
assert(parent);
if (!parent->has_ref()) {
logger().debug("{}: acquiring parent {}", __func__, parent);
logger().debug("{}: acquiring parent {}", __func__,
static_cast<void*>(parent));
parent->acquire_ref();
} else {
logger().debug("{}: parent has ref {}", __func__, parent);
logger().debug("{}: parent has ref {}", __func__,
static_cast<void*>(parent));
}
}
if (maybe_get_first_child(pin.range) != nullptr) {

View File

@ -599,7 +599,7 @@ struct ConnResult {
" cnt_accept_dispatched: {}\n"
" cnt_reset_dispatched: {}\n"
" cnt_remote_reset_dispatched: {}\n",
this,
static_cast<const void*>(this),
index, *conn,
state,
connect_attempts,