Unix Extension & "du"

Jeremy Allison jra at samba.org
Fri Sep 17 16:35:39 GMT 2004

On Fri, Sep 17, 2004 at 09:53:00AM +0200, Peter Waechtler wrote:
> But you have stat.st_blocks and stat.st_blocksize.

These are not in the POSIX spec for the stat structure.

> In the ALU (allocation unit - always a multiple of FS blocksize) CIFS wants
> that in terms of number of bytes.
> InformationLevel Data Block Encoding Description 
> LARGE_INTEGER Total Number of Allocation units on the Volume 
> LARGE_INTEGER Number of free Allocation units on the Volume 
> ULONG Number of sectors in each Allocation unit 
> ULONG Number of bytes in each sector
> So if your device has stat.st_blocksize of 4096, I would return
> 8 as "Number of sectors in each Allocation unit " and 
> 512 as "Number of bytes in each sector"

We do that in the CIFS call, but the UNIX call is meant to
conform more to POSIX specs (IMHO). You don't want to have
to make 2 calls to get one piece of info.


More information about the samba-technical mailing list