Skip to content

osd/SnapMapper: use fmt::format() instead of fmt::sprintf() - #69099

Merged
SrinivasaBharath merged 1 commit into
ceph:mainfrom
MaxKellermann:osd_SnapMapper__fmt_no_sprintf
Jul 28, 2026
Merged

SrinivasaBharath merged 1 commit into
ceph:mainfrom
MaxKellermann:osd_SnapMapper__fmt_no_sprintf

Conversation

@MaxKellermann

Copy link
Copy Markdown
Member

fmt::sprintf() is a legacy API and cannot use custom formatters.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

fmt::sprintf() is a legacy API and cannot use custom formatters.

Signed-off-by: Max Kellermann <[email protected]>
@MaxKellermann
MaxKellermann requested a review from a team as a code owner May 26, 2026 11:14
@MaxKellermann

Copy link
Copy Markdown
Member Author

jenkins test api

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates SnapMapper (OSD component) to stop using fmt::sprintf() and instead use fmt::format(), aligning the code with the modern fmtlib API and enabling use of custom formatters.

Changes:

  • Replaced fmt::sprintf() key-building code paths with fmt::format() using fmt-style format specs.
  • Dropped the now-unused #include <fmt/printf.h> include from SnapMapper.cc.

@ronen-fr ronen-fr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message does not provide a good-enough reason for the change in this case, but it is not a bad idea.

@MaxKellermann

Copy link
Copy Markdown
Member Author

Oh well. The LLM summary is longer than the actual commit. How useless.

@tchaikov tchaikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sseshasa

Copy link
Copy Markdown
Contributor

@SrinivasaBharath
SrinivasaBharath merged commit 33afffc into ceph:main Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants