[openbeosstorage] Partitionable Space (was re: Amiga RDB)

  • From: Tyler Dauwalder <tyler@xxxxxxxxxxxxx>
  • To: openbeosstorage@xxxxxxxxxxxxx
  • Date: Tue, 27 May 2003 02:24:48 -0700

> [...]
> > > Seriously, I don't dislike the BPartitionableSpace objects, but I
> > > would
> > > at least want to move them out of the BPartition objects, making
> > > them
> > > available on request only. And given the little info the bear, a
> > > BPartitioningInfo with a method bool GetPartitionableSpaceAt(int32
> > > index, off_t *position, off_t *size) should be sufficient.
> > 
> > So, you'd want to make access to partitionable space go through a
> > flat,
> > index-based mechanism, and then map the returned extents into the
> > appropriate partitions by hand?
> 
> I'm not sure, if I get, what you mean. The GetPartitionableSpaceAt()
> returns the same info as BPartition::PartitionableSpaceAt()->Offset()/
> Size().

I mean, you're wanting a single, linear mapping of partitionable space 
over each device, correct? I.e., a single BPartitioningInfo object per 
device.

Why not just BPartition::PartitionableSpaceAt(int32 index, off_t 
*position, off_t *size) then? Pulling that information out of the 
partition hierarchy when it's just going to need to be mapped right 
back in again doesn't make any sense to me. What does that gain?

> There would be a second method, GetPartitionedSpaceAt(), with the same
> parameters which would return the space actually occupied by a
> partition. The alternative to that is to add these information to
> BPartition, which might indeed be the better approach. I thought of
> keeping it out of BPartition to save 16 bytes (that aren't of interest
> for any other applications but DriveSetup), but considering that we
> reserve 512 bytes for name and type of the partition, this wouldn't
> really matter that much.
>
> The new methods to be introduce we be something like
> UsableSpaceOffset() and UsableSpaceSize() (or nicer names :-). 
> Offset()
> and Size() would then return the offset/size of the whole space
> occupied by the partition.

Again, I don't see why pulling that out of BPartition is a good idea.

-Tyler

Other related posts: