Skip to content

rename: nvme_ -> libnvme_ prefix for all library symbols - part 1#3234

Open
igaw wants to merge 2 commits intolinux-nvme:masterfrom
igaw:rename-part-1
Open

rename: nvme_ -> libnvme_ prefix for all library symbols - part 1#3234
igaw wants to merge 2 commits intolinux-nvme:masterfrom
igaw:rename-part-1

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented Apr 2, 2026

Rename all library-level symbols from nvme_ to libnvme_ prefix.

https://lore.kernel.org/linux-nvme/20260317150521.GA7382@lst.de/

@igaw igaw requested a review from Copilot April 2, 2026 15:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Renames library-facing symbols and types from the nvme_ prefix to libnvme_ across the codebase (part 1), including public APIs, internal helpers, and example consumers.

Changes:

  • Renamed exported functions/types/macros from nvme_libnvme_ across core library and utilities.
  • Updated internal structs (e.g., global context, transport handle, MI endpoint) and call sites to the new libnvme_ identifiers.
  • Updated linker version scripts and examples to reference new exported symbol names.

Reviewed changes

Copilot reviewed 42 out of 139 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
libnvme/src/nvme/util.c Renames public utility APIs (status/errno mapping, UUID helpers, get_version, etc.) to libnvme_*.
libnvme/src/nvme/uring.c Renames io_uring helpers and updates types/constants to libnvme_*.
libnvme/src/nvme/sysfs.c Renames sysfs path helper functions to libnvme_*.
libnvme/src/nvme/private.h Renames core internal types (ctx/handle/log/etc.), constants, and internal prototypes to libnvme_*.
libnvme/src/nvme/no-json.c Updates no-json stubs to accept struct libnvme_global_ctx *.
libnvme/src/nvme/nbft.h Renames NBFT public APIs to libnvme_read_nbft / libnvme_free_nbft and updates docs.
libnvme/src/nvme/nbft.c Updates NBFT implementation to use libnvme_* logging/ctx and renamed public functions.
libnvme/src/nvme/mi.h Adjusts MI API types to reference renamed internal endpoint/handle types.
libnvme/src/nvme/mi.c Renames MI internals and updates calls to new libnvme_* passthru and quirk constants.
libnvme/src/nvme/mi-mctp.c Updates MI MCTP transport to renamed MI/core types and libnvme_msg.
libnvme/src/nvme/log.c Renames logging plumbing to __libnvme_msg and public logging accessors to libnvme_*.
libnvme/src/nvme/linux.h Renames Linux helper APIs (TLS/key handling, host id helpers, etc.) to libnvme_*.
libnvme/src/nvme/lib.h Renames public core library APIs to libnvme_* (ctx lifecycle, open/close, handle accessors).
libnvme/src/nvme/lib.c Implements renamed core APIs and updates internal open/close/uring/ioctl usage.
libnvme/src/nvme/lib-types.h Renames exported command structs to libnvme_passthru_cmd / libnvme_uring_cmd.
libnvme/src/nvme/json.c Updates JSON config read/update/dump logic to use libnvme_* accessors/types.
libnvme/src/nvme/ioctl.h Renames ioctl API declarations to libnvme_* and updates docs accordingly.
libnvme/src/nvme/ioctl.c Updates ioctl implementation to renamed handle/cmd types and LIBNVME_IOCTL_* macros.
libnvme/src/nvme/filters.h Renames scan/filter APIs to libnvme_* and adjusts parameter types.
libnvme/src/nvme/filters.c Updates scan/filter implementations and sysfs dir helpers to libnvme_*.
libnvme/src/nvme/fabrics.h Renames fabrics config/URI types and updates various function signatures to new types.
libnvme/src/nvme/cmds.c Renames public command helpers (logs, telemetry, ANA, feature helpers) to libnvme_*.
libnvme/src/nvme/cleanup.h Updates URI cleanup helper to struct libnvme_fabrics_uri **.
libnvme/src/libnvme.ld Updates exported symbol list from nvme_* to libnvme_* under existing version node.
libnvme/src/accessors.ld Updates exported accessor symbol list from nvme_* to libnvme_* under existing version node.
libnvme/examples/telemetry-listen.c Updates example to use libnvme_* types and APIs.
libnvme/examples/mi-mctp.c Updates MI example to use libnvme_* types/passthru APIs and ctx lifecycle.
libnvme/examples/mi-mctp-csi-test.c Updates MI CSI test example to use libnvme_* ctx and passthru/log APIs.
libnvme/examples/mi-mctp-ae.c Updates MI AE example to use libnvme_* global ctx APIs.
libnvme/examples/mi-conf.c Updates MI config example to use libnvme_* global ctx APIs.
libnvme/examples/display-tree.c Updates topology display example to libnvme_* types/iterators and ctx lifecycle.
libnvme/examples/display-columnar.c Updates columnar display example to libnvme_* types/iterators and ctx lifecycle.
libnvme/examples/discover-loop.c Updates discovery loop example to libnvme_* ctx/host/ctrl types and APIs.
fabrics.c Updates nvme-cli fabrics code to use libnvme_* public APIs and types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@igaw igaw force-pushed the rename-part-1 branch 2 times, most recently from 1465f8e to e2e0bcf Compare April 2, 2026 16:02
Use a different prefix for the non NVMe specification part of the
library. This avoids confusion what is NVMe specific and what part of
the API is from the library itself.

Links: https://lore.kernel.org/linux-nvme/20260317150521.GA7382@lst.de/
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Split the NVMe definitions from the library API.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants