NFS
NFS(Network File System)是典型 client-server remote file system:server export directory,client mount 到本機 namespace,application 用普通 path / syscalls 存取 remote files。課本主要討論 Solaris NFS Version 3。
重要 caveat:stateless server 是 NFS v3 的特徵,不可推廣到所有 NFS;NFS v4 引入更多 stateful mechanisms 來改善 security、locking、performance、delegation。
VFS integration
Client syscall → VFS 找到 remote vnode → NFS client procedure → RPC / XDR 到 server → server 端 VFS 操作 local FS → 回傳結果。這讓一台 machine 可同時是 NFS client 和 server。
Protocol split
- D-OS-Ch15ha-NFS_Mount_Protocol:檢查 export policy,建立 initial logical connection,回傳 initial file handle。
- D-OS-Ch15hb-NFS_Protocol:處理 lookup、read directory、read、write、attributes 等 remote operations。
Namespace semantics
NFS mount 是 per-client:client A 的 mount 不影響 client B。NFS 不具 transitivity:client mount server export 後,不一定看到 server 在該 subtree 上另行 mount 的其他 FS。Cascading mounts 可讓一條 path lookup 涉及多個 servers。
Performance / consistency
NFS 使用 caching、read-ahead、delayed writes 讓 remote access 可用;代價是削弱 strict D-OS-Ch15ga-UNIX_Semantics,例如某 client 的 new file / writes 不一定立刻被其他 clients 看見。