Re: Possibly OT: no. of blocks allocated to a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> which is same as one would expect. It doesn't show any extra block allocated to this file.
> 
> Can you mail output on your system?
> 
> niTin

Well Nitin, that's surprising! Check this out:

[karthik@darkstar ch1]$ ./blocks blocks.c
size: 637
blksize: 4096
blocks: 16
blocks * 512 = 8192

I ran the blocks program on its own source - as you can see, it only
requires 4096 bytes, since the file size is 637 bytes, but the
allocated amount is 8192 bytes, 4096 in excess of what is required.

Here's a table of file sizes vs. allocated block sizes that I compiled
on my machine:
File    Allocated
-----------------------
0       4096
1024    8192
2048    8192
3072    8192
4096    8192
5120    12288
6144    12288
7168    12288
8192    12288
9216    16384

Regards,
Karthik.

-- 
There are things known and things unknown, in between lie the Doors

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux