4 ms·
Hi, I did not understand the arithmetic behind indirect pointers and the file size it can store. It says "A single indirect pointer can point - (12 + 1024) * 4
by SairajK19 3y ago
Hi, I did not understand the arithmetic behind indirect pointers and the file size it can store.
It says "A single indirect pointer can point - (12 + 1024) * 4 KiB" that is 4MiB file.
My question is, what does 1024 represent. I understand 12 is the number of direct pointers and we are multiplying it by 4 considering a pointer takes 4 bytes of space. Would help if anyone explains it.
Might be a silly question, sorry about that. But ya, thanks for the help!
- deleted 3y ago[deleted]
- deathanatos 3y agoWe're pointing to a block of data; that's the 4 KiB. You have 12 direct pointers — that's the "12". The "1024" appears to be the single indirect pointers: it seems like the inode only has 1 "single indirect pointer", so that points to a block's worth of pointers. (Hence the "indirect" part.) A block in this design is 4 KiB, and a pointer in this design is 4 B, so the block of pointers will hold 4 KiB / (4 B/pointer) = 1024 pointers — that's the "1024".
- SairajK19 3y agoThat explains it well. It's the number of pointers that a 4KiB block can hold. I got it. Many thanks.
- deleted 3y ago[deleted]