Chinaunix首页 | 论坛 | 博客
  • 博客访问: 333048
  • 博文数量: 102
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 1146
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-21 22:33
文章分类

全部博文(102)

文章存档

2011年(8)

2010年(94)

我的朋友

分类: LINUX

2010-01-21 23:32:43

2010/1/1下午:
ulk 18.1 general character of ext2/3
features: fragmentation in blocks with little file size.
compressed encrypted files
logical deletion:刪除文件是否最終erase data blocks?  only change bitmap is enough.

Directory

 


中間的這個圖,包含了謻謻的意思
我把ulk的解釋放在這兒 吧

The file_type field stores a value that specifies the file type (see Table 18-4). The rec_len field may be interpreted as a pointer to the next valid directory entry: it is the offset to be added to the starting address of the directory entry to get the starting address of the next valid directory entry. To delete a directory entry, it is sufficient to set its inode field to 0 and suitably increment the value of the rec_len field of the previous valid entry. Read the rec_len field of Figure 18-3 carefully; you'll see that the oldfile entry was deleted because the rec_len field of usr is set to 12+16 (the lengths of the usr and oldfile entries). 


3. ext3 inode information
i_block number,,used to locate file's inode...allocate file's data-blocks and allocate new inode,in parent directory's inode block number.


4 Creating the Ext2 Filesystem


Many of the VFS methods described in  have a corresponding Ext2 implementation. Because it would take a whole book to describe all of them, we limit ourselves to briefly reviewing the methods implemented in Ext2. Once the disk and the memory data structures are clearly understood, the reader should be able to follow the code of the Ext2 functions that implement them.


我觉得理解了disk上的data&info布局后,了解disk&memory之间的映射关系,再加上buffer/page-cache/vfs的一些处理,再看code就变得相当的容易了...这样比较便于最短的时间理解一个文件系统的设计理念...



突然有个更野的目标...打算看完ext3后,再看ext4/btrfs...


现在在看ext3_load_journal这部分.初始化的时候,如何处理disk上的journal区,是根据已知的(parse mount options)还是b-dev,有不同的routine.ext3_get_journal/dev_journal()...


fill_super时,可能根据不同的option,决定是load journal or create a new one,,for "create" example, ext3 do the alloc/initialize work,then journal core need do future work.


ex:ext3_create_journal-->get_journal-->jounal_create() 


note:

journal本身也是root directory里的一个inode,在create的过程中,除了在内存中建立相应的journal_t的inode映象,也要通过journal core对它进行初始化,清0,在disk相应的block里写入相应journal的raw datas.journal_create()时会读入block到buffer经过处理后,写回.journal_reset完了会update_journal superblock,即先在内存中建立journal_superblock_t的disk数据,处理完成后写回disk.


后面会启动journal thread 主线程. 

阅读(905) | 评论(0) | 转发(0) |
0

上一篇:Journal Ext3 Notes

下一篇:ext3目录查找

给主人留下些什么吧!~~