vfs-file-operations-and-fops
Installation
SKILL.md
VFS File Operations & fops
The per-method contract the VFS imposes on struct file_operations
implementations. Each fops callback has exact return semantics; the driver
owns private_data lifetime, the struct file refcount, and the module
refcount. Load references/README.md before writing a new .read /
.write / .llseek / .open / .release / .unlocked_ioctl path.
When to use
- Writing, reviewing, or debugging a driver that installs a
struct file_operationson a device node, char device, proc/debugfs file, or other VFS object. - Implementing
.open/.release,.read/.write,.llseek,.unlocked_ioctl/.compat_ioctl. - Reasoning about
private_datalifetime,struct filerefcounting (get_file / fput), or the module-unloaded-while-open class of bugs. - Reviewing patches for CWE-416 / CWE-476 / CWE-252 regressions inside file-operation callbacks.