]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/SnapMapper: use fmt::format() instead of fmt::sprintf() 69099/head
authorMax Kellermann <max.kellermann@ionos.com>
Mon, 14 Oct 2024 20:29:39 +0000 (22:29 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Tue, 26 May 2026 11:12:43 +0000 (13:12 +0200)
fmt::sprintf() is a legacy API and cannot use custom formatters.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
src/osd/SnapMapper.cc

index aa1e557667e39e3b7e68f18cda75263b1cfcb111..6a25ef94aa2321095e5e22ff5bfd2e60f0ea4cfc 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "SnapMapper.h"
 
-#include <fmt/printf.h>
 #include <fmt/ranges.h>
 
 #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<uint64_t>(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<uint64_t>(last));