]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | MDS internal data structures |
2 | ============================== | |
3 | ||
4 | *CInode* | |
5 | CInode contains the metadata of a file, there is one CInode for each file. | |
6 | The CInode stores information like who owns the file, how big the file is. | |
7 | ||
8 | *CDentry* | |
9 | CDentry is the glue that holds inodes and files together by relating inode to | |
10 | file/directory names. A CDentry links to at most one CInode (it may not link | |
11 | to any CInode). A CInode may be linked by multiple CDentries. | |
12 | ||
13 | *CDir* | |
14 | CDir only exists for directory inode, it's used to link CDentries under the | |
15 | directory. A CInode can have multiple CDir when the directory is fragmented. | |
16 | ||
17 | These data structures are linked together as:: | |
18 | ||
19 | CInode | |
20 | CDir | |
21 | | \ | |
22 | | \ | |
23 | | \ | |
24 | CDentry CDentry | |
25 | CInode CInode | |
26 | CDir CDir | |
27 | | | \ | |
28 | | | \ | |
29 | | | \ | |
30 | CDentry CDentry CDentry | |
31 | CInode CInode CInode | |
32 | ||
33 | As this doc is being written, size of CInode is about 1400 bytes, size of CDentry | |
34 | is about 400 bytes, size of CDir is about 700 bytes. These data structures are | |
35 | quite large. Please be careful if you want to add new fields to them. | |
36 | ||
11fdf7f2 TL |
37 | *OpenFileTable* |
38 | Open file table tracks open files and their ancestor directories. Recovering | |
39 | MDS can easily get open files' paths, significantly reducing the time of | |
40 | loading inodes for open files. Each entry in the table corresponds to an inode, | |
41 | it records linkage information (parent inode and dentry name) of the inode. MDS | |
42 | can constructs the inode's path by recursively lookup parent inode's linkage. | |
43 | Open file table is stored in omap of RADOS objects, table entries correspond to | |
44 | KV pairs in omap. |