Specific Layout. Why doing so?-Forperformance...The inodes in a particular group will usually refer to thedatablocksinthesamegroup.So,thiskeepsthemclosetogetherina physical senseThe storage device may be able to locate the data inafastermanner.(Remembertheprincipleoflocality?)Group0Group1Groupn-1
Specific Layout • Why doing so? – For performance. . The inodes in a particular group will usually refer to the data blocks in the same group. So, this keeps them close together in a physical sense. The storage device may be able to locate the data in a faster manner. (Remember the principle of locality?) Group 0 Group 1 Group n-1
Layout in EachGroupGBlockInodeInodeDataDSuperblockBitmapBitmapTableBlocksTSuperblockStoresFSspecificdataTotalnumberofinodesinthesystem.Totalnumberofblocksinthesystem.NumberofreservedblocksTotalnumberoffreeblocksTotal numberof free inodesLocationofthefirstblockThesizeofablock12
Superblock Stores FS specific data. Superblock G D T Block Bitmap Inode Bitmap Inode Table Data Blocks Layout in Each Group Total number of inodes in the system. Total number of blocks in the system. Number of reserved blocks Total number of free blocks. Total number of free inodes. Location of the first block. The size of a block. 12
Layout inEachGroupGDBlockInodeDataInodeSuperblockBitmapBitmapTableBlocksTSuperblockStoresFSspecificdata.E.g.,thetotalnumberofblocks,etcIt stores:-Thestartingblocknumbersoftheblockbitmap,theinodeGDT-GroupDescriptorTablebitmap,andtheinodetable.-Freeblockcount,freeinodecount,etc...InodeTableAnarrayofinodesorderedbytheinode#DataBlocksAnarrayofblocksthatstoredfilesBlockBitmapAbitstringthatrepresentsifablockisallocatedornot.InodeBitmapAbitstringthatrepresents ifaninodeisallocatedornot.13
Superblock Stores FS specific data. E.g., the total number of blocks, etc. GDT – Group Descriptor Table It stores: -The starting block numbers of the block bitmap, the inode bitmap, and the inode table. - Free block count, free inode count, etc. Superblock G D T Block Bitmap Inode Bitmap Inode Table Data Blocks Layout in Each Group Inode Table An array of inodes ordered by the inode #. Data Blocks An array of blocks that stored files. Block Bitmap A bit string that represents if a block is allocated or not. Inode Bitmap A bit string that represents if an inode is allocated or not. 13
Layout in Each Group What is a block bitmap?-A sequence of bits indicates the allocation oftheblocksItsays“blocks0-2areallocated"then“block3isunallocated”0Unallocated1AllocatedGDTBlockInodeDataInodeSuperblockBitmapBitmapTableBlocks
Layout in Each Group • What is a block bitmap? – A sequence of bits indicates the allocation of the blocks. It says “blocks 0-2 are allocated ”, then “block 3 is unallocated ”. 1 1 1 0 1 0 1 1 1 0 1 1 0 Unallocated 1 Allocated Superblock G D T Block Bitmap Inode Bitmap Inode Table Data Blocks
Layout in Each Group. Then, what is an inode bitmap?-A sequence of bits indicates the allocation oftheinodes This implies that..The number of files in the file system is fixed!0Unallocated1AllocatedGDTInodeBlockInodeDataSuperblockBitmapBitmapTableBlocks
Layout in Each Group • Then, what is an inode bitmap? – A sequence of bits indicates the allocation of the inodes. – This implies that. Superblock G D T Block Bitmap Inode Bitmap Inode Table Data Blocks 1 1 1 0 1 0 1 1 1 0 1 1 0 Unallocated 1 Allocated The number of files in the file system is fixed!