libnvme: rename sysfs to attrs, move generated files to a subdir - #3787
Open
martin-belanger wants to merge 2 commits into
Open
libnvme: rename sysfs to attrs, move generated files to a subdir#3787martin-belanger wants to merge 2 commits into
martin-belanger wants to merge 2 commits into
Conversation
added 2 commits
August 7, 2026 16:27
"sysfs" is Linux-only terminology for a mechanism meant to work on Windows too (and possibly others). Also moves the generated .c/.h files into src/nvme/generated/ Signed-off-by: Martin Belanger <martin.belanger@dell.com>
…subdir keep generated files out of src/nvme/ so they're visually separate from the hand-written files around them. Also fixes stale-header fallback bugs this move would otherwise cause: tid.c/tid.h, exclusion.c, and discoverd/src/tid.h all reference these headers via the public "nvme/accessors-fabrics.h" path rather than a same-directory include, which was silently resolving to a stale copy in /usr/include from a previous install once the real file moved. Also fixes a -Werror build break introduced by the generated/ subdir move: nvme_incdir (added in the previous commit to let a quoted #include "private.h" resolve from nvme/generated/*.c) put -Ilibnvme/src/nvme on every compile command, which made libnvme/src/nvme/endian.h's own #include <endian.h> resolve back to itself instead of glibc's real header -- #pragma once silently no-ops the self-reference, dropping the declarations for htole64/htobe64/etc. Only visible as a warning locally; CI builds with --werror, where it's fatal. Removes nvme_incdir and instead makes both generators emit correct explicit relative includes (../private.h, ../private-fabrics.h) for the headers they parsed, now that their .c output lives one directory below. Verified with --werror (default and -Dfabrics=disabled), full test suite, and a live smoke test. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
martin-belanger
force-pushed
the
attr-accessors-rename
branch
from
August 7, 2026 21:15
8bf5229 to
d9336c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renames the lazy-caching accessor mechanism from "sysfs" to "attrs" terminology, and moves every generator-owned file into a new
src/nvme/generated/subdirectory.Most of this PR is purely a mechanical substitution of "sysfs" by "attrs". Not all sysfs were replaced by attrs though. I kept sysfs for things that really reference Linux's sysfs.
Two commits, in review order:
libnvme: rename sysfs to attrs and move generated files to a subdir-- the lazy ctrl/path/ns/subsystem accessor rename and move.libnvme: move accessors.[ch] and accessors-fabrics.[ch] to generated subdir. Also fixes a real, non-obvious bug this move would otherwise cause:tid.c/tid.h,exclusion.c, anddiscoverd/src/tid.hall referenceaccessors-fabrics.hvia the publicnvme/accessors-fabrics.hpath rather than a same-directory include, which was silently falling through to a stale copy in/usr/includefrom a previous install once the real file moved.