From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 11 00:39:45 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A1AA16A418 for ; Mon, 11 Feb 2008 00:39:45 +0000 (UTC) (envelope-from mpp@mppsystems.com) Received: from lugdush.gulftel.com (lugdush.gulftel.com [216.231.163.39]) by mx1.freebsd.org (Postfix) with ESMTP id E491C13C467 for ; Mon, 11 Feb 2008 00:39:44 +0000 (UTC) (envelope-from mpp@mppsystems.com) Received: from localhost (localhost [127.0.0.1]) by lugdush.gulftel.com (Postfix) with ESMTP id C1848C40A; Sun, 10 Feb 2008 17:27:40 -0600 (CST) X-Virus-Scanned: amavisd-new at gulftel.com Received: from lugdush.gulftel.com ([127.0.0.1]) by localhost (lugdush.gulftel.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DLcW-YcQCaHo; Sun, 10 Feb 2008 17:27:36 -0600 (CST) Received: from mail.mppsystems.com (unknown [99.194.188.184]) by lugdush.gulftel.com (Postfix) with ESMTP id E5A81C388; Sun, 10 Feb 2008 17:27:34 -0600 (CST) Received: by mail.mppsystems.com (Postfix, from userid 1000) id 9146B17025; Sun, 10 Feb 2008 17:27:33 -0600 (CST) Date: Sun, 10 Feb 2008 17:27:33 -0600 From: Mike Pritchard To: Tod McQuillin Message-ID: <20080210232733.GA3240@mail.mppsystems.com> References: <20080209220206.695e5d9b.yngwiie@bk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: mutt-ng/devel-r804 (FreeBSD) X-Mailman-Approved-At: Mon, 11 Feb 2008 00:57:25 +0000 Cc: freebsd-hackers@freebsd.org, Ivan Georgiev Subject: Re: quotactl returns double values X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2008 00:39:45 -0000 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)