QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1063|回复: 1

请教,急!

[复制链接]
发表于 2003-5-12 20:55:25 | 显示全部楼层 |阅读模式
小弟最近在看Linux 2.4.18的文件系统部分的内核,看到EXT2对磁盘块的写操作那段,就是函数generic_file_write(struct file *file,const char *buf,size_t count, loff_t *ppos)不清楚,不知道这里的对具体的磁盘块的读写是通过哪个函数来的,是在commit_write(file, page, offset, offset+bytes)里吗,但是commit_write(file, page, offset, offset+bytes)这个函数的代码又查不到。还有page ,buffer_head ,还有block之间的关系是怎么样的,
请各位大侠指教!谢谢!
发表于 2003-5-12 22:35:46 | 显示全部楼层
yes, dirty data block are written in commit_write. it is a function pointer in a struct address_space_operations. in ext2, this a_ops is defined in fs/ext2/inode.c as ext2_aops. it uses the generic_commit_write() defined in fs/buffer.c. generic_commit_write simply marks the bh as dirty and lower block layer will handle it and write to disk later.

about page, bh, and block (what u block means?), u had better read some doc. i can not describe it clearly here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-2 02:28 , Processed in 0.049520 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表