What are 4 ways to implement the free space list ?

+1 vote
13 views

+1 vote
by (user.guest)
selected by (user.guest)

There are 4 ways to implement the free space list such as:

• Bit Vector:  The free space list is implemented as a bit map or bit vector. Each block is represented as 1 bit. If the block is free, the bit is 1 and if it is allocated then the bit is 0. For example, consider a disk where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 17, 18, 25, 26 & 27 are free and rest of the blocks are allocated. The free space bit map would be

0011110011111100011000000111……………………..

The main advantage of this approach is that it is simple and efficient to find the first free block or n consecutive free blocks on the disk. But bit vectors are inefficient unless the entire vector is kept in main memory. It is possible for smaller disks but not for larger ones.

• Linked List: Another approach is to link together all the free disk blocks and keep a pointer to the first free block. The first free block contains a pointer to the next free block and so on. For example, we keep a pointer to block 2 as the free block. Block 2 contains a pointer to block which points to block 4 which then points to block 5 and so on. But this scheme is not efficient.

To traverse the list, we must read each block which require a lot of I/O time.

• Grouping: In this approach, we store the address of n free blocks in the first free block. The first n-1 of these blocks is actually free. The last block contains the address of another n free blocks and so on. Here the addresses of a large number of free blocks can be found out quickly.

• Counting: Rather than keeping a list of n free disk block addresses, we can keep the address of the first free block and the number of free contiguous blocks. So here each entry in the free space list consists of a disk address and a count.

+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote