nx_mvault_layout.nx
buildroot/runtime/nx_mvault_layout.nx
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
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
| 28 | func dp_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: mv_disk_path |
| 34 | func dp_ch(dst: *u8, off: i64, ch: i64) -> i64 called by 1: mv_disk_path |
| 41 | func mv_disk_path(out: *u8, root: *u8, class_code: i64, type_code: i64, called by 5: do_classifydo_retypedo_recordmainmv_classify_plan calls 4: mv_class_strmv_type_strdp_catdp_ch |