File Control Block

File Control Block(FCB)是描述「一個 file」的 metadata record;UNIX 常見實作是 inode,NTFS 類似資訊在 MFT record。


What FCB Contains

  • permission / ACL。
  • owner / group。
  • timestamps。
  • file size。
  • file type。
  • data-block locations:direct pointers、index blocks、extents 等。

Directory entry 主要是 name → FCB;FCB 則回答這個 file 的屬性與資料 blocks 在哪裡。

file name in directory → FCB / inode → data blocks

FCB in Memory

File 被 open 時,kernel 常把 FCB cache 到 system-wide open-file table。後續 read/write 不必重查 directory;最後一個 close 後再視 dirty state 寫回。

D-OS-Ch14bb-Open_File_Table_Implementation