A: Sure, here is what my solution produces for image.20:
csci5103> debug superblock: 20 blocks 3 inode blocks 384 inodes inode 2: size: 27160 bytes direct blocks: 4 5 6 7 8 indirect block: 9 indirect data blocks: 13 14 inode 3: size: 9546 bytes direct blocks: 10 11 12
A: Both are correct! In a real filesystem, the number of inode blocks is chosen when the disk is formatted, so an operating system must be prepared to deal with whatever number of inode blocks are specified in the superblock. However, your format routine should always compute ten percent.
A: In this case, the format call should do nothing and return failure.
A: No. Format should do the minimum work necessary to create a blank filesystem. A blank filesystem should have a valid superblock and no valid inodes. It doesn't matter what's in the data blocks, since no inodes refer to them.
Now, if you were really worried about someone stealing your disk and then writing their own code to examine the data in blocks that were not in use, then a really aggressive filesystem would actually fill unused blocks with zeroes during a format or a delete. But, you don't have to do this.
A: A delete on an invalid inode should do nothing and return failure.