From owner-cvs-all Sat Aug 21 11:24: 9 1999 Delivered-To: cvs-all@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id 3EAAB14E14; Sat, 21 Aug 1999 11:24:04 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.2) with ESMTP id UAA14391; Sat, 21 Aug 1999 20:23:54 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Bruce Evans Cc: green@FreeBSD.org, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_physio.c In-reply-to: Your message of "Sat, 21 Aug 1999 18:18:44 +1000." <199908210818.SAA12283@godzilla.zeta.org.au> Date: Sat, 21 Aug 1999 20:23:54 +0200 Message-ID: <14389.935259834@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk In message <199908210818.SAA12283@godzilla.zeta.org.au>, Bruce Evans writes: > It should be written >something like: > > blockno = uio->uio_offset >> DEV_BSHIFT; > if ((daddr_t)blockno != blockno) > barf(); > bp->b_blkno = blockno; Ok, I used this one. I prefer compiler generated checks rather than #defines I have to locate and figure out the meaning of first. >btodb() probably shouldn't cast to daddr_t. This mainly prevents its >use in code like the above. It is not a feature that it may prevent >warnings about truncation when off_t's are assigned to daddr_t's. btodb() probably shouldn't be used for off_t... -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." FreeBSD -- It will take a long time before progress goes too far! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message