From owner-freebsd-scsi Mon Oct 6 06:37:33 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA28263 for freebsd-scsi-outgoing; Mon, 6 Oct 1997 06:37:33 -0700 (PDT) (envelope-from owner-freebsd-scsi) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA28255; Mon, 6 Oct 1997 06:37:24 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id XAA03686; Mon, 6 Oct 1997 23:35:17 +1000 Date: Mon, 6 Oct 1997 23:35:17 +1000 From: Bruce Evans Message-Id: <199710061335.XAA03686@godzilla.zeta.org.au> To: julian@whistle.com, phk@critter.freebsd.dk Subject: Re: New SCSI Framework Patches Available Cc: davidg@FreeBSD.ORG, freebsd-scsi@FreeBSD.ORG, joerg_wunsch@uriah.heep.sax.de Sender: owner-freebsd-scsi@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >my new disk layer stuff basically works in byte offsets. >it starts with b_blkno, but all comparisins etc. end up being >u_int64_t based.. > >(offset_t?) off_t? Other parts of the system don't even pretend to support offsets >= 2^63. Negative offsets on disks are errors, but negative relative offsets may be useful. >> >> > I would prefer a transition from b_blkno to b_offset, thereby >> >> > eliminating all the ``shift right here, shift back left there'' mess >> >> > completely. >> >> I agree. >me too There is no way to eliminate the shift that converts filesystem blocks to disk blocks or bytes. Currently, this is the only shift invovled in the usual case where the h/w block size == DEV_BSIZE (at least in 2.2; in -current there are several evil multiplications and divisions in sd.c and od.c just to support unusual cases). If offsets were used everywhere, there would be an additional shifts or division to convert from byte offsets to h/w block numbers. >though I'd like to leave the b_pblkno, or maybe make it a b_poffset. I think it should be a block number (in h/w disk block size units) and all checking and conversions of buffer offsets and ranges should be centralized in dscheck(). It doesn't need to be 64 bits yet. I think the (time) bloat for b_offset instead of b_blkno would be less than the current bloat for just one of the evil divisions in sd.c. Not good, but probably acceptable. Bruce