Remove dead code and simplify code introduced during sidecar migration
Follow up improvement effort to improve code introduce in https://github.com/sysprog21/elfuse/pull/256
Summary by cubic
Removes sidecar-era paths and cuts per-lookup work in casefold and sysroot resolution. Old: each component copied prefixes, re-derived realpath() and object types, and rebuilt resolver outputs; new: probe components in place, reuse ATTR_CMN_OBJTYPE, skip redundant realpath() and concatenations, and treat fully typed walks as containment proofs.
-
Probe components in place: append candidates to
outand restore its terminator.outdoubles as probe scratch; do not overlapoutwithguest_pathorbase_host_prefix. -
Reuse object types from the probe: record
leaf_type_known,leaf_is_link, andall_types_known. Runfstatat/faccessatonly when types are unknown.host_component_spellingexposes link-ness to the NO_XDEV walker. -
Skip the sysroot containment recheck for a fully typed walk; keep it for listing-answered components, dot components, and byte-exact paths.
-
Canonicalize the sysroot once and read
_Atomicfold/canonical flags. Avoid per-callrealpath()and skip sysroot snapshots for relative paths. -
Remove unread resolver outputs and duplicate sysroot+lookup concatenations; rely on the seed buffer.
-
Make the walk report optional in
casefold_resolve_at; pass NULL when only the verdict oroutis needed. -
Move the UTF-8/UTF-16 budget oracles into tests; drop
casefold_utf16_unitsfromcasefold.h. -
Fixes
- Withdraw type info on
readdirfallback so callers do not skip requiredfstatatchecks. - Bounds-check
getattrlistatstored-name replies; prevent an overlong append from leaving a trailing/. - Make the escape fallback strict: on broken preconditions, return an error rather than guess a spelling.
- Withdraw type info on