Re: Expand libdisk to use 64bit size/offset

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 10 Mar 2004 17:34:08 -0500
On Wednesday 10 March 2004 02:16 pm, Bruce Evans wrote:
> On Wed, 10 Mar 2004, John Baldwin wrote:
> > On Tuesday 09 March 2004 07:37 pm, Jun Kuriyama wrote:
> > > I found sysinstall(8) cannot handle TB class storage.  It looks
> > > both of libdisk and sysinstall should be fixed.
> > >
> > > I'm trying to improve this situation, but I'm not sure I'm going to
> > > the right direction.  Please look this patch (including my debugging
> > > stuff and XXX comments which should be resolved/removed).
>
> This will probably need EFI, since DOS partitions are limited to 2^31
> or 2^32 sectors and the sector size may be restricted to 512.
>
> > > http://www.imgsrc.co.jp/~kuriyama/BSD/libdisk-20040310.diff
>
> I didn't look closely.
>
> > > I choose daddr_t as larger storage for offset, size and end member of
> > > "struct chunk".  I think offset and end is okay, but I don't know
> > > daddr_t for offset is correct or not.
> >
> > dadd_t is a uint32_t, so it won't help.  Just use off_t for chunk
> > offset/size/end.
>
> Erm, daddr_t is (signed) int64_t.  It is the correct type for storing
> counts of DEV_BSIZE'd blocks (DEV_BSIZE = 512), so it is correct for
> sector counts in libdisk to the extent that libdisk is limited to
> DEV_BSIZE'd sectors.  Counts of blocks of other sizes should use a
> different typedef.  E.g., ufs uses types ufs1_daddr_t (32-bit ufs1
> block numbers), ufs2_daddr_t (64-bit ufs2 block numbers) and ufs_lbn_t
> (64-bit ufs logical block numbers).

Bah, I looked for u_daddr_t (which is 32-bit (why?)).

-- 
John Baldwin <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Wed Mar 10 2004 - 13:33:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:46 UTC