Wednesday, July 8, 2015

WAFL file system



http://www.slideshare.net/taotao1240/wafl-overview

Advfs


BMT: (block map table) BMT stores all inode blocks index
RBMT:      reserved BMT
TAG dir:  stores directory TAG

 TAG ID  |  BMT ID | GEN | ..

Advfs like ext4, is also a extended fs, means use (offset, len) to directly locate data blocks,
don't need indirect blocks to locate.

Under ext3,
hardlink is just a new dentry which has the same inode
softlink is just a new dentry
For hardlinks, if file inode migrates,  hardlink would become dangling denty.


The problem is hard to find all the hardlinks. But with TAG dir table,
all hardlink dentry share the same TAGID, then it won't have the same dangling dentry issue.

TAGID should be able to find BMT ID



Journaling
Replay journal: mostly use by File System
Rollback journal: used by database



Data journal: everything writes to journal including data blocks
Writeback?? journal: journal only commits after real data commits
... journal:  journal doesn't ganranttee real data commits.



Donedone:



Snapshot:
Each snapshot has [birth, death]
death = -1 means still alive

snapshot chain, COW,
new -> .... -> old









All hard links to a physical file share the same inode, and have the same inode id number. Therefore, if you know the inode number of a file, you can find all hard links to the file by searching for files with the same inode number.

To display a file's inode number, use ls -i:

$ ls -li file1
2655341 -rw-r--r-- 3 peter peter 0 2008-09-02 19:09 file1
-xdev means don't search in other filesystem
$ find /home -xdev -inum 2655341
/home/peter/file1
/home/peter/tmp/file3
/home/peter/file2