Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 1999 20:23:54 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        green@FreeBSD.org, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern kern_physio.c 
Message-ID:  <14389.935259834@critter.freebsd.dk>
In-Reply-To: Your message of "Sat, 21 Aug 1999 18:18:44 %2B1000." <199908210818.SAA12283@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14389.935259834>