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

Re: quotactl returns double values

On Sun, Feb 10, 2008 at 01:04:24PM +0900, Tod McQuillin wrote:
> On Sat, 9 Feb 2008, Ivan Georgiev wrote:
> >I was just playing, trying to see how quotactl works,
> >but in all my tries the values returned are doubled,
> >
> >the values stored in my_st->dqb_bhardlimit and my_st->dqb_curblocks
> >are the real values times two, the hard limit on the user is 102400K,
> >but my_st->dqb_bhardlimit holds 204800K.
> I hope you are remembering that the limits are measured in blocks -- a block is 
> 512 bytes.
> Thus a limit of 102400K is 204800 blocks, since each 1K holds 2 blocks.

You can also use "quota -r" to dump out the raw quota data.

Simple answer is, internally the quota system maintains its block counts 
by counting the # of blocks that would be returned by stat(2) in the
st_blocks field, which is the # of 512-byte blocks used by the file.
Externally, (e.g. what it displays, takes as input) is 1024-byte blocks counts.
Mike Pritchard
mpp @ FreeBSD.org
"If tyranny and oppression come to this land, it will be in the guise
of fighting a foreign enemy."  - James Madison (1787)
freebsd-hackers_(_at_)_freebsd_(_dot_)_org mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe_(_at_)_freebsd_(_dot_)_org"

Visit your host, monkey.org