Skip to content

vms-d69 (P4-VFS V2b): extract ODS-2 allocator + dir scanner + header codec to vmsfs-core over the block/inode seam - #428

Merged
baron-3dl merged 2 commits into
mainfrom
vms-d69-vmsfs-bio-extract
Aug 13, 2026
Merged

baron-3dl merged 2 commits into
mainfrom
vms-d69-vmsfs-bio-extract

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

What

Builds seam #2 — the block/inode seam designed in src/kernel/vmsfs/README-backend.md §3 (rd vms-d69, epic vms-8e8), completing the ODS-2 core extraction. The block-coupled ODS-2 logic that still lived in vmsfs_blkdev.c — the storage/FID/cluster allocator, the directory-block scanner, and file-header read/write — moves into src/kernel-core/vmsfs/, rewritten against a substrate-neutral vmsfs_bio vocabulary. After this, src/kernel/vmsfs/ is the thin VFS + vmsfs_bio backend; all ODS-2 logic is in the core.

The seam as built (vs README §3)

  • vmsfs_bio (block half, §3a): struct vmsfs_volume (geometry + bitmap + opaque host) embedded in vmsfs_sb_info; opaque struct vmsfs_bh; ops vmsfs_bget/vmsfs_bdata/vmsfs_bdirty[_sync]/vmsfs_bput, vmsfs_bit_find_zero/set/clear/test, vmsfs_le*_to_cpu/vmsfs_cpu_to_le*, vmsfs_now_seconds — declared in the core vmsfs_bio.h, realized as trivial forwarders in vmsfs_backend_linux.h (sb_bread/mark_buffer_dirty/find_next_zero_bit/le*_to_cpu/ktime_get_real_seconds). Mirrors the exec-core exec_kbackend.h pattern.
  • vmsfs_fh_info (inode half, §3b): POD + pure vmsfs_fh_decode/vmsfs_fh_encode; the backend keeps only the thin POD <-> struct inode copy.
  • Two design refinements (noted in README §3): vmsfs_fh_decode returns an enum vmsfs_fh_status (so the backend reproduces the original's three distinct diagnostics/errnos: EIO magic, EIO checksum, ENOENT not-in-use) rather than a bare int; and flush/rename use explicit partial-update writers (vmsfs_fh_write_meta/vmsfs_fh_write_rename) rather than a decode-on-write, preserving every untouched on-disk field.

New core files (0 <linux/>): vmsfs_bio.h, vmsfs_alloc.c, vmsfs_dirscan.c, vmsfs_header.c.

Behaviour: ZERO change (Rule 6/7)

Behaviour-preserving restructure; guarantee is BEHAVIOUR, proven by the QEMU oracle. test_kmod_vmsfs_blkdev + every vmsfs suite is byte-identical baseline vs after:

suite baseline after
test_kmod_vmsfs 19/0 19/0
test_kmod_vmsfs_blkdev 51/0 51/0
test_kmod_vmsfs_exepath 28/0 28/0
test_kmod_vmsfs_mountvis 7/0 7/0
test_kmod_vmsfs_readdir 8/0 8/0
test_kmod_vmsfs_rename 26/0 26/0
test_kmod_vmsfs_sysgroup 4/0 4/0
FINAL 70 suites / 0 failed 70 suites / 0 failed

make -C src/kernel/vmsfs compiles clean before and after.

Invariants

  • src/kernel-core/vmsfs/** has 0 <linux/> includes (grep-verified).
  • src/kernel/vmsfs/** contains no ODS-2 allocator/dir/header algorithm — only VFS + the vmsfs_bio impl. (find_next_zero_bit/set_bit/… gone from the backend; sb_bread/mark_buffer_dirty remain only as VFS block I/O around core calls.)
  • No facility_defects.sh anchor repoint needed: its coverage glob is kernel-core/*.c (non-recursive), so kernel-core/vmsfs/*.c is unscanned — consistent with the existing vmsfs core files; the kernel/vmsfs scope-out is unaffected (vmsfs_blkdev.c stays there with vmsfs_blkdev_rename intact).

This completes the ODS-2 core extraction. V4 (NetBSD vnode backend, rd vms-308) can now be written 1:1 against the seam (README §4 checklist updated).

🤖 Generated with Claude Code

alice and others added 2 commits August 13, 2026 02:58
…codec to vmsfs-core over the block/inode seam

Builds seam #2 (README-backend.md §3): a vmsfs_bio vocabulary (struct
vmsfs_volume + vmsfs_bget/bdata/bdirty[_sync]/bput/bit_*/le*_to_cpu/
now_seconds, realized in vmsfs_backend_linux.h) and the vmsfs_fh_info
parse/populate split. The storage/FID/cluster allocator (vmsfs_alloc.c),
the directory-block scanner (vmsfs_dirscan.c) and the file-header
decode/encode (vmsfs_header.c) now live in src/kernel-core/vmsfs/ with 0
<linux/> deps; vmsfs_blkdev.c is the thin VFS + vmsfs_bio backend.

Behaviour-preserving restructure (Rule 6/7): oracle is QEMU
test_kmod_vmsfs_blkdev + the other vmsfs suites.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…NetBSD checklist

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baron-3dl
baron-3dl merged commit aca814d into main Aug 13, 2026
58 of 60 checks passed
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.

1 participant