Expand libdisk to use 64bit size/offset

Bruce Evans bde at zeta.org.au
Wed Mar 10 22:26:42 PST 2004


On Wed, 10 Mar 2004, John Baldwin wrote:

> On Wednesday 10 March 2004 02:16 pm, Bruce Evans wrote:
> > On Wed, 10 Mar 2004, John Baldwin wrote:
> > > 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
> > ...
>
> Bah, I looked for u_daddr_t (which is 32-bit (why?)).

Yikes.  Because it didn't get updated when daddr_t was.  I think it is
not for unsigned disk addresses like its name suggests, but is for a
bitmap of disk addresses, so it works up to disk address 2^(31+3) (8TB).
I think it also only used for swap space disk addresses, and swap has
other limits and shouldn't have size 8TB anyway (yet).  So using only
32-bits for it is a good optimization.  It is just a bit dangerous since
there are no systematic overflow checks and it will overflow someday.

Bruce


More information about the freebsd-current mailing list