frosten 发表于 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之间的关系是怎么样的,
请各位大侠指教!谢谢!

Dragonfly 发表于 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.
页: [1]
查看完整版本: 请教,急!