this repo is notes of Linux f2fs file system in my preparation of porting f2fs to Windows.
figure | description |
|
figure | description |
|
|
|
|
|
|
|
name | type | description |
cp_lock | spin | description |
cp_global_sem | RW | description |
cp_rwsem | RW | write, when checking point read, when fs operation |
locks on Node Manager | - | Node Manager |
locks on Segment Manager | - | Segment Manager |
figure | description | |||||||||||||||
|
||||||||||||||||
|
figure | description | ||||||||||||||||||
|
when there is no free block for a current segment, f2fs will select a new segment. if there is need for SSR(Slack Space Recycling), f2fs will select from dirty segments, or else f2fs will select from free segments.
gc is the process of cleaning dirty segment, blocks are moved out from dirty segment to other segments, which makes more free segments.
- f2fs use page cache to read node into memory , and will lock the page cache from concurrent access. it has the exclusive semantics.
- for example, in f2fs_get_dnode_of_data, f2fs will read I Node , if needed, f2fs will allocate a Direct Node, and fill its nid into I Node. if the page cache is not locked, 2 thread might overwrite each other.
- Windows lacks similar facility.