]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: add struct inode_operations + VFS dispatch with fallback
authorTulio A M Mendes <[email protected]>
Sat, 14 Feb 2026 01:19:42 +0000 (22:19 -0300)
committerTulio A M Mendes <[email protected]>
Sat, 14 Feb 2026 01:19:42 +0000 (22:19 -0300)
commita2bac64af69e6830dfcb18cbb7642cf7ab3fbefc
treee6f670295e145931928ec49571272afe6753eb80
parent29c1545418d399f76c894c123d648d0d254a85ec
refactor: add struct inode_operations + VFS dispatch with fallback

Infrastructure for separating file_operations (per-fd I/O) from
inode_operations (namespace/metadata):

- fs.h: added struct inode_operations with lookup, readdir, create,
  mkdir, unlink, rmdir, rename, truncate, link callbacks
- fs.h: added i_ops pointer to fs_node_t alongside existing f_ops
- fs.c: VFS dispatch checks i_ops first, falls back to f_ops for
  all namespace operations (lookup, create, mkdir, unlink, rmdir,
  rename, truncate, link)
- syscall.c: getdents dispatch checks i_ops->readdir first

This is backward-compatible: all existing filesystems continue to
work through the f_ops fallback path. Each FS will be migrated
individually in subsequent commits.

20/20 smoke tests pass.
include/fs.h
src/kernel/fs.c
src/kernel/syscall.c