fs/omfs/file.c
Source file repositories/reference/linux-study-clean/fs/omfs/file.c
File Facts
- System
- Linux kernel
- Corpus path
fs/omfs/file.c- Extension
.c- Size
- 9335 bytes
- Lines
- 381
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/fs.hlinux/buffer_head.hlinux/mpage.homfs.h
Detected Declarations
function OMFSfunction omfs_make_empty_tablefunction omfs_shrink_inodefunction omfs_truncatefunction omfs_grow_extentfunction find_blockfunction omfs_get_blockfunction omfs_read_foliofunction omfs_readaheadfunction omfs_writepagesfunction omfs_write_failedfunction omfs_write_beginfunction omfs_bmapfunction omfs_setattr
Annotated Snippet
const struct file_operations omfs_file_operations = {
.llseek = generic_file_llseek,
.read_iter = generic_file_read_iter,
.write_iter = generic_file_write_iter,
.mmap_prepare = generic_file_mmap_prepare,
.fsync = simple_fsync,
.splice_read = filemap_splice_read,
};
static int omfs_setattr(struct mnt_idmap *idmap,
struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = d_inode(dentry);
int error;
error = setattr_prepare(&nop_mnt_idmap, dentry, attr);
if (error)
return error;
if ((attr->ia_valid & ATTR_SIZE) &&
attr->ia_size != i_size_read(inode)) {
error = inode_newsize_ok(inode, attr->ia_size);
if (error)
return error;
truncate_setsize(inode, attr->ia_size);
omfs_truncate(inode);
}
setattr_copy(&nop_mnt_idmap, inode, attr);
mark_inode_dirty(inode);
return 0;
}
const struct inode_operations omfs_file_inops = {
.setattr = omfs_setattr,
};
const struct address_space_operations omfs_aops = {
.dirty_folio = block_dirty_folio,
.invalidate_folio = block_invalidate_folio,
.read_folio = omfs_read_folio,
.readahead = omfs_readahead,
.writepages = omfs_writepages,
.write_begin = omfs_write_begin,
.write_end = generic_write_end,
.bmap = omfs_bmap,
.migrate_folio = buffer_migrate_folio,
};
Annotation
- Immediate include surface: `linux/module.h`, `linux/fs.h`, `linux/buffer_head.h`, `linux/mpage.h`, `omfs.h`.
- Detected declarations: `function OMFS`, `function omfs_make_empty_table`, `function omfs_shrink_inode`, `function omfs_truncate`, `function omfs_grow_extent`, `function find_block`, `function omfs_get_block`, `function omfs_read_folio`, `function omfs_readahead`, `function omfs_writepages`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.