Hi Brian,
The number of blocks calculated by PVFS2 is the size of the file in bytes
rounded up to the next multiple of 4K measured in terms of number of 512
byte units (du and df legacies) (since we don't actually keep track of
any disk block level mappings or such).
So a file size of 150263 translates to ((150263 + 4095) & ~4095)/512 = 296
blocks.

Ext2/3 calculate number of blocks slightly differently since they need to
account for blocks that are used to maintain things like single indirect
block, double indirect block, triple indirect block, extended attributes,
ACLs and so on.
So the number of blocks will depend on the file size. In your case a
file size of 150263 bytes requires one extra indirect block, so the
calculation would be (((150263 + 4095) & ~4095) + (1 * 4096)) / 512 = 304
blocks (assuming no xattrs, acls etc)
Hopefully that addresses your questions,
Thanks
Murali

> > [EMAIL PROTECTED] ~]$ stat /scratch/xxx/file
> > File: `/scratch/xxx/file'
> >   Size: 150263          Blocks: 296        IO Block: 4194304
> > regular file
> > Device: 13h/19d Inode: 1046003     Links: 1
> > Access: (0644/-rw-r--r--)  Uid: (1288406/xxx)   Gid: (  100/   users)
> > Access: 2006-01-10 16:48:35.000000000 -0500
> > Modify: 2006-01-10 16:48:35.000000000 -0500
> > Change: 2006-01-10 16:48:35.000000000 -0500
> >
> > [EMAIL PROTECTED] ~]$ stat /home/student/x/xxx/file
> >   File: `/home/student/x/xxx/file'
> >   Size: 150263          Blocks: 304        IO Block: 4096   regular
> > file
> > Device: 811h/2065d      Inode: 63047415    Links: 1
> > Access: (0644/-rw-r--r--)  Uid: (1229806/xxx)   Gid: (  100/   users)
> > Access: 2006-01-19 21:24:41.000000000 -0500
> > Modify: 2006-01-19 21:18:02.000000000 -0500
> > Change: 2006-01-19 21:18:02.000000000 -0500
> >
> You will see some minor differences in the results from fstat on a
> pvfs2 mount than elsewhere.  Murali was explaining to me the reason
> for this the other day, but after the weekend I don't remember the
> details :-).  I'll leave it to him to elaborate.

_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to