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:
- [dir_fh] — directory file handle
- [name] — filename as XDR opaque
- [type(4)] — NFS3 file type constant
- [sattr3(24)] — set-attributes structure (
nfs3_sattr3_zero()helper emits the "don't set" form) - [device_data(8)] — major/minor pair, emitted only for
BLKandCHRtypes
Type constants: REG, DIR, BLK, CHR, LNK, SOCK, FIFO.
All 17 NFS3 procedures
With MKNOD landing, every standard NFS3 procedure (procs 0–17) is implemented.
| Proc | Name | Proc | Name |
|---|---|---|---|
| 0 | NULL | 9 | MKDIR |
| 1 | GETATTR | 10 | SYMLINK |
| 2 | SETATTR | 11 | MKNOD (RFC) |
| 3 | LOOKUP | 12 | REMOVE |
| 4 | ACCESS | 13 | RMDIR |
| 5 | READLINK | 14 | RENAME |
| 6 | READ | 15 | LINK |
| 7 | WRITE | 16 | READDIR |
| 8 | CREATE | 17 | READDIRPLUS / 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:
| Suite | Before | After |
|---|---|---|
| NFS3 procedures | 16/17 (MKNOD stub) | 17/17 |
| btrfs readdir (nested paths) | stub | component-walk live |
| Total harness | 350/350 | 351/351 |