Re: ddm interface for Intel partitioning system

Ingo Weinhold <bonefish-CFLBMwTPW48UNGrzBIF7/[email protected]> Sat, 19 May 2007 16:06:12 +0200
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <[email protected]>
On 2007-05-19 at 12:59:22 [+0200], Tomáš Kučera <[email protected]> wrote:
> >> partition_supports_initializing
> >The module responsible
> >for extended partitions cannot initialize anything but what the parent
> >partitioning system (partition map) has marked an extended partition.
> >
> >If no partition is given, the question to answer is only if the 
> >partitioning
> >system supports initialization at all. This holds analoguously for all of 
> >the
> >partition_supports_*() hooks, IIRC.
> 
> So all the partition_supports_*() hooks, if a partition is specified, 
> should say
> if we can perform that action on a given partition and 
> partition_validate_*()
> hooks just only check given parameters?
> If we have e.g. intel partition map system and we already have 4 primary
> partitions, we cannot create another child partition. Should the hook
> partition_supports_creating_child() fail or should it just say "yes" 
> (because
> we can generally create child partitions) and then
> partition_validate_create_child() fails, because we already have 4 child
> partitions?

Good question. We haven't defined the semantics of all hooks precisely. In 
the end both partition_supports_*() and partition_validate_*() are mainly 
services for a partition manager, so their semantics should be fine-tuned to 
assist it with its work best. Therefore I think, if a partition is given, 
the partition_supports_*() hook should indeed check current partition 
properties that would restrain the partitioning system from performing the 
task. In case of partition_supports_creating_child() that means, it should 
check whether there are already four partitions, also whether there's enough 
space left for another partition.

The semantics of the partition_validate_*() hooks is well defined, though: 
They check whether an operation can be performed with the given parameters. 
They adjust the parameters to the closest value that would make the 
operation performable. If that's not possible, they fail. That also means, 
if a validation hook succeeds, invoking the hook actually performing the 
operation with the validated parameters must succeed, unless unexpected 
errors occur (e.g. out of memory, device write error).

CU, Ingo

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Open-beos-kernel-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open-beos-kernel-devel