Skip to contentSkip to conversation

File size and block size

DISCUSSION Anthony Chee 1 participant 1 message Apr 18, 2002 VFS

lore
Share & tools
lore
#0 lore raw

I found some relevant information in "Understanding the Linux Kernel, O'reilly" P.517, figure 17-5. It said EXT2_N_BLOCKS is 15. Does it mean the size of blocks pointed by 12, 13, 14 are also 15?

And I extract a file stat from debugfs,

BLOCKS:
(0):1088, (1-11):16939-16949, (IND):16950, (12-22):16951-16961, (23-46):17961-17
984, (47-51):18059-18063
TOTAL: 53

Why there is only one IND, and no IND in 23-46?

Thanks.

----- Original Message -----
From: "Bryan Henderson" <[email protected]>
To: "Anthony Chee" <[email protected]>
Cc: <[email protected]>
Sent: Thursday, April 18, 2002 8:54 AM
Subject: Re: File size and block size

Quoted 10 lines
Quoted 3 lines

2. Copy a file with 34024 bytes to the target disk, it should occupy 34024/1024 = 33.2 = 34 blocks. But I found that it occupied 35 blocks

Remember the pointer blocks. That extra block contains the disk addresses of the 34 data blocks. When you had only 4 blocks, their addresses fit in the inode, so you didn't see additional pointer blocks.