From: Max Kellermann Date: Mon, 14 Oct 2024 20:29:39 +0000 (+0200) Subject: osd/SnapMapper: use fmt::format() instead of fmt::sprintf() X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=adfbcec205d75f1064af8f405031bcf9ca1f3905;p=ceph.git osd/SnapMapper: use fmt::format() instead of fmt::sprintf() fmt::sprintf() is a legacy API and cannot use custom formatters. Signed-off-by: Max Kellermann --- diff --git a/src/osd/SnapMapper.cc b/src/osd/SnapMapper.cc index aa1e557667e3..6a25ef94aa23 100644 --- a/src/osd/SnapMapper.cc +++ b/src/osd/SnapMapper.cc @@ -15,7 +15,6 @@ #include "SnapMapper.h" -#include #include #include "common/ceph_context.h" @@ -279,7 +278,7 @@ string SnapMapper::get_prefix(int64_t pool, snapid_t snap) // note: the snap_id is to be formatted as a 64-bit hex number, // and not according to the text representation of snapid_t ceph_assert(snap != CEPH_NOSNAP && snap != CEPH_SNAPDIR); - return fmt::sprintf("%s%lld_%.16X_", + return fmt::format("{}{}_{:016X}_", MAPPING_PREFIX, pool, static_cast(snap)); @@ -873,7 +872,7 @@ void SnapMapper::update_snap_map( string SnapMapper::make_purged_snap_key(int64_t pool, snapid_t last) { ceph_assert(last != CEPH_NOSNAP && last != CEPH_SNAPDIR); - return fmt::sprintf("%s_%lld_%016llx", + return fmt::format("{}_{}_{:016x}", PURGED_SNAP_PREFIX, pool, static_cast(last));