Date: Sun, 10 Feb 2008 17:27:33 -0600 From: Mike Pritchard <mpp@mail.mppsystems.com> To: Tod McQuillin <devin@spamcop.net> Cc: freebsd-hackers@freebsd.org, Ivan Georgiev <yngwiie@bk.ru> Subject: Re: quotactl returns double values Message-ID: <20080210232733.GA3240@mail.mppsystems.com> In-Reply-To: <alpine.BSF.1.00.0802101303030.3053@plexi.pun-pun.prv> References: <20080209220206.695e5d9b.yngwiie@bk.ru> <alpine.BSF.1.00.0802101303030.3053@plexi.pun-pun.prv>
next in thread | previous in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080210232733.GA3240>