-
Notifications
You must be signed in to change notification settings - Fork 0
[Lower Layer] Inode
buck5060 edited this page Jan 3, 2018
·
17 revisions
Please move to https://hackmd.io/EwBgRiBsCMDGAsBaeBDAZpZsDsBmRYArLgJyKzQrAAmJ1YkAHNGkA===?view This page need to be modified. Let's move to hackmd page to learn our design.
- Matedata of a file or directory
- Following are the object included
total length limitation: 128byte
設計num[12]的子表,用於num[]用盡的時候另開block儲存資料
| 寬度 | 型態 | 命名 | 用途 |
|---|---|---|---|
| 2byte | short | id | inode id |
| 4byte | int | filesize | filesize(更動file內容時需要一並更新) |
| 2byte | short | uid | UID |
| 2byte | short | gid | GID |
| 2byte | short | filemode |
4664 == drw-rw-r--) |
| 4byte | time_t | timestamp | 最後修改日期(更動此inode時需要一並更新) |
| 2byte | short | filetype | |
| 2byte | short | name_len | |
| 15*4byte | int | num[15] |
block number (file) or |
| 32byte | char[32] | filename | filename |
檔案類型改存於inode -> filetype (1 = Regular file, 2 = Directory, 詳見inode_entry.h) , 不放在filemode
用途:當num用盡時的儲存表,indirect block map size limit: 1 block
| 寬度 | 型態 | 命名 | 用途 |
|---|---|---|---|
| 2byte | short | num12[512] | block number |
用途:存和indoe相關的資訊 size limit: 1 block
| 寬度 | 型態 | 命名 | 用途 |
|---|---|---|---|
| 2byte | Short | block_used | 已用block數 |
| 2byte | Short | block_unuse | 未用block數 |
| 2byte | Short | inode_used | 已用inode數 |
| 2byte | Short | inode_unuse | 未用inode數 |
| 512byte | bitmap | inode_bitmap | inode bitmap (共4096個inode) |