[openbeosstorage] Re: BDiskSystem::Supports*()/Validate*()

  • From: Tyler Dauwalder <tyler@xxxxxxxxxxxxx>
  • To: openbeosstorage@xxxxxxxxxxxxx
  • Date: Thu, 17 Jul 2003 14:13:06 -0700

On 2003-07-16 at 16:49:38 [-0700], you wrote:
> Howdy,
> 
> now that I implemented them all, I really start to wonder, whether 
> most
> of the BDiskSystem::Supports*()/Validate*() are really needed at all.
> Some of them, like SupportsDefragmenting(), are completely equivalent
> to a BPartition method (CanDefragment() in this case). Or say, they 
> are
> even less handy, because one has a redundant parameter that the method
> needs to check (the disk system the method is invoked on must be the
> one the partition is formatted with (or its parent partition for some
> methods)).
> 
> Others, like BDiskSystem::SupportsResizing() give different 
> information
> than BPartition::CanResize(). In fact the latter one is the result of
> an AND of BDiskSystem::SupportsResizing() and SupportsResizingChild().
> The question is: Are the individual pieces of information returned by
> the latter ones of interest or not?

I believe I had envisioned functions like BPartition::CanResize() being 
implemented by specifically calling BDiskSystem::SupportsResizing() for 
the appropriate disk system and then anding it with a call to 
SupportsResizingChild(). Doing it like you have by calling the kernel 
functions directly is fine, too, though. And as you mention, I guess 
it's more efficient, too. :-)

> So, what I think about is to
> 1) drop the BDiskSystem::Validate*() methods entirely,

Fine by me.

> 2) drop the BPartition* parameter of the Supports*() methods -- they
> would return only, if the disk system in principle has the
> capabilities, but not whether it can be done for a certain partition.

Sounds okay also. 

> So, the only remaining methods with a BPartition* parameters would be
> GetNextSupportedType(), which enumerates possible partition types for
> children of a partition, and IsSubSystemFor(), which tells whether the
> disk system is a subsystem of the system on the supplied partition
> (e.g. the `intel extended partition' system would be a subsystem for a
> `intel partition map' partition).
> 
> What do you think?

Looks good to me, I say go for it. :-)

-Tyler

Other related posts: