ftp/nfs卸载自定义文件系统数据( 二 )


大小
名字
描述
4
大小
文件系统的大小,以块为单位
4
根目录
根目录的起始块的序号
4
位图块
位图块的数量,以块为单位
500


位图块:
位图块的每一位,标记文件系统某一块的使用与否 。如果被使用,设为1,否则为0 。
位图块的第0字节第0位标识块0,依次类推 。
位图块的数量 = 文件系统的块数/ (512字节*8)
数据块:存放数据(目录或文件)
struct u_fs_disk_block {size_t size;// how many bytes are being used in this blocklong nNextBlock; //The next disk block, if needed. This is the//next pointer in the linked allocation listchar data[MAX_DATA_IN_BLOCK];//And all the rest of the space in};
数据块的结构:
大小
名字
描述
4
大小
此数据块被使用的字节 。
4
下一块
文件的下一数据块的序号 。若无,则设为-1
504
数据
存放数据 。
目录:对于目录所在的数据块,在数据部分会存储一连串的记录 。记录条数不限 。
【ftp/nfs卸载自定义文件系统数据】struct u_fs_file_directory {char fname[MAX_FILENAME + 1];//filename (plus space for nul)char fext[MAX_EXTENSION + 1];//extension (plus space for nul)size_t fsize;//file sizelong nStartBlock;//where the first block is on diskint flag;//indicate type of file. 0:for unused; 1:for file; 2:for directory};