Luci Stanescu wrote:
> On Wed, Jul 19, 2006 at 03:14:02PM -0400, Florin Malita wrote:
>
>> Or - asta ar fi raspunsul corect pentru Luci - ext2 (si ext3) au aceeasi
>> limitare si intern: i_blocks (nr de blocuri de date alocate in unitati
>> de 512 bytes) e reprezentat pe 32 biti atat in struct ext{2,3}_inode cat
>> si (mai grav) pe disc:
>>
>> http://lxr.free-electrons.com/source/include/linux/ext2_fs.h#221
>>
> Gandul ma duce la faptul ca acel i_blocks din struct ext2_inode masoara
> numarul de block-uri din definitia ext2-ului: un block = 1/2/4 etc. KiB
Intuitiv asa te-ai fi asteptat dar nu, i_blocks (la fel ca si
corespondentul st_blocks din 'struct stat' in userspace) contine numarul
de unitati de alocare de 512B - numele campului induce in eroare.
http://ext2read.sourceforge.net/ext2fs.htm - "*i_blocks:* The number of
blocks reserved for the file. The block is not the size of the block but
the sector size ie. 512 bytes."
http://www.oreilly.com/catalog/linuxkernel2/chapter/ch17.pdf - "the
i_blocks field stores the number of data blocks (in units of 512 bytes)
that have been allocated to the file."
http://www.cs.uky.edu/~raphael/courses/CS585/chap17.refs.txt - "i_blocks
(alloc, units of 512B)"
man 2 stat: "The value st_blocks gives the size of the file in
512-byte blocks."
http://www.delorie.com/gnu/docs/glibc/libc_284.html - "
`blkcnt_t st_blocks'
This is the amount of disk space that the file occupies,
measured in units of 512-byte blocks.
...
`unsigned int st_blksize'
The optimal block size for reading of writing this file, in
bytes. You might use this size for allocating the buffer
space for reading of writing the file. (This is unrelated to
`st_blocks'.)
"
[EMAIL PROTECTED] ~]$ grep -B1 BSIZE /usr/include/sys/param.h
/* Unit of `st_blocks'. */
#define DEV_BSIZE 512
---
fm
_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug