Bird
Raised Fist0

If a file system is extended to support variable-sized blocks instead of fixed-size blocks, how should the inode structure be adapted to efficiently locate file data blocks?

hard🎤 Interviewer Follow-up Q10 of Q15
Operating Systems - Inode Structure - File Metadata & Block Pointers
If a file system is extended to support variable-sized blocks instead of fixed-size blocks, how should the inode structure be adapted to efficiently locate file data blocks?
AReplace block pointers with a list of (block address, block size) pairs to handle variable sizes
BKeep fixed direct and indirect pointers but add block size metadata in the inode
CUse a bitmap in the inode to track variable-sized block allocation
DStore only the starting block and rely on file size to calculate block boundaries
Step-by-Step Solution
Solution:
  1. Step 1: Understand variable block size impact

    Variable-sized blocks require storing both address and size to locate data precisely.
  2. Step 2: Evaluate inode pointer adaptation

    Fixed pointers (B) assume uniform block size, so they are insufficient. Bitmaps (C) track allocation but not block sizes. Storing only start block (D) cannot handle variable sizes.
  3. Step 3: Confirm best approach

    Storing (block address, block size) pairs (A) allows precise location and size info per block.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    Variable block sizes require explicit size info per block [OK]
Quick Trick: Variable blocks need size info stored with pointers [OK]
Common Mistakes:
MISTAKES
  • Assuming fixed pointers suffice or relying on file size alone
Trap Explanation:
PITFALL
  • Candidates often overlook the need to store block size with address for variable blocks.
Interviewer Note:
CONTEXT
  • Tests ability to adapt inode design for non-standard block allocation.
Master "Inode Structure - File Metadata & Block Pointers" in Operating Systems

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Operating Systems Quizzes