Files
oldlinux-files/study/sabre/os/files/FileSystems/ext2fs/ext2fs_6.html
2024-02-19 00:25:23 -05:00

39 lines
1.8 KiB
HTML

<!-- X-URL: http://step.polymtl.ca/~ldd/ext2fs/ext2fs_6.html -->
<!-- This HTML file has been created by texi2html 1.29
from ext2fs.texi on 3 August 1994 -->
<TITLE>Analysis of the Ext2fs structure - Bitmaps</TITLE>
<P>Go to the <A HREF="ext2fs_5.html">previous</A>, <A HREF="ext2fs_7.html">next</A> section.<P>
<A NAME="IDX22"></A>
<H1><A NAME="SEC6" HREF="ext2fs_toc.html#SEC6">Bitmaps</A></H1>
<P>
The ext2 file system uses bitmaps to keep track of allocated blocks
and inodes.
<A NAME="IDX23"></A>
<A NAME="IDX24"></A>
<P>
The blocks bitmap of each group refers to blocks ranging from the first
block in the group to the last block in the group. To access the bit of
a precise block, we first have to look for the group the block belongs
to and then look for the bit of this block in the blocks bitmap
contained in the group. It it very important to note that the blocks
bitmap refer in fact to the smallest allocation unit supported by the
file system: fragments. Since the block size is always a multiple of
fragment size, when the file system manager allocates a block, it
actually allocates a multiple number of fragments. This use of the
blocks bitmap permits to the file system manager to allocate and
deallocate space on a fragment basis.
<A NAME="IDX25"></A>
<A NAME="IDX26"></A>
<P>
The inode bitmap of each group refer to inodes ranging from the first
inode of the group to the last inode of the group. To access the bit of
a precise inode, we first have to look for the group the inode belongs
to and then look for the bit of this inode in the inode bitmap contained
in the group. To obtain the inode information from the inode table, the
process is the same, except that the final search is in the inode table
of the group instead of the inode bitmap.
<P>
<P>Go to the <A HREF="ext2fs_5.html">previous</A>, <A HREF="ext2fs_7.html">next</A> section.<P>