fs/ramfs/file-mmu.c
—该文件中为ramfs_file_operations、ramfs_aops ramfs_file_inode_operations
的具体初始化。—
const struct address_space_operations ramfs_aops = {
.readpage = simple_readpage,
.write_begin = simple_write_begin,
.write_end = simple_write_end,
.set_page_dirty = __set_page_dirty_no_writeback,
};
该结构中为ramfs的“地址空间”结构.
将缓存数据与其来源之间建立关联。该结构用于ramfs向内存模块申请内存页,并提供从后备数据来源读取数据并填充缓冲区以及将缓冲区中的数据写入后备设备等操作。
const struct file_operations ramfs_file_operations = {
.read = do_sync_read,
.aio_read = generic_file_aio_read,
.write = do_sync_write,
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.fsync = noop_fsync,
.splice_read = generic_file_splice_read,
.splice_write = generic_file_splice_write,
.llseek = generic_file_llseek, };
该结构为ramfs中文件的通用文件操作函数集合。
const struct inode_operations ramfs_file_inode_operations = {
.setattr = simple_setattr,
.getattr = simple_getattr,
};
该结构包括ramfs的文件节点操作函数集合。