Consider a file currently consisting of 83 blocks. Assume that the file control block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguous allocation case, assume that there is room to grow in the beginning and in the end. Assume that the block information to be added is stored in memory. For linked allocation, there is a head and tail pointer pointing respectively to the first and last node. Note that while calculating the total number of I/O operations for each, also indicate how many are from r (read) and w (write). For each part, if there is more than one answer, choose the one that gives you the least number of I/O operations. The block is removed from the beginning The block is added after 41st block The block is removed from the end Assumptions: Read one whole block = one I/O operation Write one whole block = one I/O operation The directory information for each allocation is already in the RAM. If the directory information is updated, it does not need to be written back to the disk For linked allocation, a file allocation table (FAT) is not used, i.e., only the address of the starting and ending block is in memory All preparation of a block (including putting in the data and any link value) is done in main memory and then the block is written to disk with one write operation The file control block does not have to be written to disk after a change (this is typical where many operations are performed on a file) At most one index block is required per file and it does not have to be written to disk after a change For linked, contiguous and indexed allocations, assume that no I/O operations are necessary to add a freed block to the free list The OS has information about the free blocks. It does not have to go to the disk to find a free block When a block is removed, nothing needs to be written to that disk block indicating it is removed
Consider a file currently consisting of 83 blocks. Assume that the file control block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguous allocation case, assume that there is room to grow in the beginning and in the end. Assume that the block information to be added is stored in memory. For linked allocation, there is a head and tail pointer pointing respectively to the first and last node.
Note that while calculating the total number of I/O operations for each, also indicate how many are from r (read) and w (write). For each part, if there is more than one answer, choose the one that gives you the least number of I/O operations.
- The block is removed from the beginning
- The block is added after 41st block
- The block is removed from the end
Assumptions:
- Read one whole block = one I/O operation
- Write one whole block = one I/O operation
- The directory information for each allocation is already in the RAM. If the directory information is updated, it does not need to be written back to the disk
- For linked allocation, a file allocation table (FAT) is not used, i.e., only the address of the starting and ending block is in memory
- All preparation of a block (including putting in the data and any link value) is done in main memory and then the block is written to disk with one write operation
- The file control block does not have to be written to disk after a change (this is typical where many operations are performed on a file)
- At most one index block is required per file and it does not have to be written to disk after a change
- For linked, contiguous and indexed allocations, assume that no I/O operations are necessary to add a freed block to the free list
- The OS has information about the free blocks. It does not have to go to the disk to find a free block
- When a block is removed, nothing needs to be written to that disk block indicating it is removed
Step by step
Solved in 2 steps