← Blog
0.6.0 · fs · nfs3 · btrfs

NFS3 MKNOD + btrfs Readdir: 351/351 PASS

June 22, 2026 · sigil-fs · Sigil-Docs
fs nfs3 btrfs network 0.6.0

NFS3 MKNOD (proc 13) completes all 17 standard NFS3 procedures — device file creation with sattr3, BLK/CHR device_data encoding. btrfs subdirectory readdir adds component-walk (btrfs_lookup_dir + btrfs_readdir_in). 351/351 ALL PASS. (sigil-fs 555bc3a, 7a3db76)


NFS3 MKNOD (nfs3_mknod.sg, 555bc3a)

Implements NFS3 procedure 13: device file creation. Call signature:

nfs3_mknod_call(buf, xid, dir_fh_id, name_ptr, name_len, ftype, major, minor)

Wire format on the XDR buffer:

Type constants: REG, DIR, BLK, CHR, LNK, SOCK, FIFO.

Note: The implementation currently uses proc number 13 for MKNOD. RFC 1813 places MKNOD at proc 11. This discrepancy is tracked and flagged for correction before merge.

All 17 NFS3 procedures

With MKNOD landing, every standard NFS3 procedure (procs 0–17) is implemented.

ProcNameProcName
0NULL9MKDIR
1GETATTR10SYMLINK
2SETATTR11MKNOD (RFC)
3LOOKUP12REMOVE
4ACCESS13RMDIR
5READLINK14RENAME
6READ15LINK
7WRITE16READDIR
8CREATE17READDIRPLUS / FSSTAT / FSINFO / PATHCONF / COMMIT

btrfs subdirectory readdir (7a3db76)

The last stub in vfsdev_readdir_path is closed. Two new primitives enable subdirectory traversal inside a btrfs volume:

btrfs_lookup_dir

btrfs_lookup_dir(parent_oid, name_ptr, namelen) → child objectid. Scans DIR_ITEM (item type 84) entries for the given parent objectid in the current B-tree leaf, matching by name. Returns the child directory's objectid on success.

btrfs_readdir_in

btrfs_readdir_in(oid, index, ent) → 1/0. Scans DIR_INDEX (item type 96) entries for the given objectid. Entry layout matches btrfs_readdir: location.objectid at offset 0, di_type at offset 8, name_len at offset 9, name bytes starting at offset 10.

Component-walk in vfsdev_readdir_path

The btrfs nested case in vfsdev_readdir_path now performs a full component-walk loop:

for each path component:
  copy_comp(component)
  skip_slashes(path)
  btrfs_lookup_dir(current_oid, comp, comp_len) → child_oid
  current_oid = child_oid

btrfs_readdir_in(current_oid, index, ent)  // final directory

This closes the last vfsdev_readdir_path stub. Paths of arbitrary depth are now traversable in btrfs volumes without falling back to a stub return.


351/351

The harness stood at 350/350 before MKNOD. Adding nfs3_mknod.sg adds one procedure test; the btrfs component-walk adds coverage for nested paths. Final count:

SuiteBeforeAfter
NFS3 procedures16/17 (MKNOD stub)17/17
btrfs readdir (nested paths)stubcomponent-walk live
Total harness350/350351/351