code wiki / (root) / nx_mvault_layout.nx

nx_mvault_layout.nx

buildroot/runtime/nx_mvault_layout.nx

2794 B65 linesdepth 5pulls 5 transitivereach 5 importersview sourcekind librarytopic mvault
docsdependenciesstructsconstsfunctions

about

nx_mvault_layout.nx -- DSM-native on-disk layout for vault blobs. GOAL (operator 2026-07-17): "structured on disk ... so it works with the synology dsm os but still has all of our capabilities so i dont have a million folders and files." LAYOUT: <root>/<class>/<type>/<shard>/<cid16>_<source>.<ext> class = gen | real (the two major sections) type = image|gif|video|audio|story|page|manga|model3d|audiobook shard = 2 hex chars of the CID (<=256 dirs per type) file = <cid16>_<source>.<ext> (real ext => DSM Photos/Video index it; CID + source VISIBLE in File Station) FAN-OUT BOUND: classes(2) x types(<=10) x shards(256) = <=5120 leaf dirs, NEVER per-item folders. Metadata does NOT live in per-item sidecars -- it lives in the seg-store (nx_mvault_record), a few segment files. So on-disk file count ~= media count, folder count ~= 5120. No million-folders trap. SELF-DESCRIBING: class/type/source/cid are all recoverable from the path alone, so DSM-side browsing works even without the seg-store; the seg-store is the rich classified+searchable index over the same blobs (ref = path). Composes nx_mvault_ingest (mv_class_str / mv_type_str). license_tier: ORIGINAL

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_mvault_ingest.nx nx_mvault_layout.nx nx_mvault.nx nx_mvault_layout_gate.nx nx_mvault_reindex.nx nx_mvault_walk.nx

imports: nx_syscalls.nxnx_mvault_ingest.nx

imported by: nx_mvault.nxnx_mvault_layout_gate.nxnx_mvault_reindex.nxnx_mvault_walk.nx

structs

none

consts

none

functions

28func dp_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: mv_disk_path
34func dp_ch(dst: *u8, off: i64, ch: i64) -> i64
called by 1: mv_disk_path
41func mv_disk_path(out: *u8, root: *u8, class_code: i64, type_code: i64,