From owner-freebsd-current@FreeBSD.ORG Mon Apr 21 06:44:46 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1233B37B409; Mon, 21 Apr 2003 06:44:46 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2273443FE5; Mon, 21 Apr 2003 06:44:44 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id XAA29665; Mon, 21 Apr 2003 23:44:41 +1000 Date: Mon, 21 Apr 2003 23:44:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: David Schultz In-Reply-To: <20030421102341.GA3482@HAL9000.homeunix.com> Message-ID: <20030421231756.H11214@gamplex.bde.org> References: <20030420192319.GB4963@HAL9000.homeunix.com> <20030421102341.GA3482@HAL9000.homeunix.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Robert Watson cc: current@freebsd.org Subject: Re: HEADS UP: UFS2 now the default creation type on 5.0-CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 13:44:46 -0000 On Mon, 21 Apr 2003, David Schultz wrote: > The cgbase hack should only limit the size of the filesystem, not > the disk location. It occurs to me that with a little more > hackery, we can avoid the limitation entirely. If we revert to > the 64-bit cgbase() and un-inline it, boot2 goes from 19 bytes > available to -9 bytes. Add a kludge to factor out a few 64-bit > multiply-adds and we're back to 3 bytes available. (I'm sure > there are cleaner ways to save 9 bytes.) An untested unpolished > diff follows. I played with similar changes, but didn't finish them. > Index: ufsread.c > =================================================================== > RCS file: /cvs/src/sys/boot/common/ufsread.c,v > retrieving revision 1.11 > diff -u -r1.11 ufsread.c > --- ufsread.c 25 Feb 2003 00:10:20 -0000 1.11 > +++ ufsread.c 21 Apr 2003 10:10:01 -0000 > ... > @@ -47,11 +59,11 @@ > ... > -#define FS_TO_VBA(fs, fsb, off) (fsbtodb(fs, fsb) + \ > - ((off) / VBLKSIZE) * DBPERVBLK) > +#define FS_TO_VBA(fs, fsb, off) ma((off) / VBLKSIZE, DBPERVBLK, \ > + fsbtodb((fs), (fsb))) The division by VBLKSIZE should probably be a shift. ufsread.c has VBLKSHIFT and uses it for all multiplications and divisions by VBLKSIZE except this one. gcc can't optimize to just a shift since all the types are signed and C99 specifies that division of negative integers by positive ones has the usual hardware brokenness. Bruce