Jack,

205, 226: How come for some cases (e.g. line 189 for partition resize)
 self._children = ShadowPhysical(self)
but other times this is not necessary? Both cases are deleting the existing partition and then calling self.parent.add_partition(). Seems like it is related to whether or not self.parent.insert_children() is called.

That's a bug in Partition.resize(). The delete() call will take care of deleting the Partition object and all children. When parent.add_partition() is called, a new Partition object will be created with _children set to a ShadowPhysical() list. I'll remove that call.


But if this is the case, what happens when change_type is called (which also delete()s and add_partition()s), followed by a call to add_slice() which calls insert_children() but does not call ShadowPhysical() first?

See above. Taking the assignment out of both resize() calls (Partition and Slice).


241-251 and 270: Assumes there will be no errant or overlapping partitions (i.e. that there will be only child.size.sectors between any two consecutive child.start_sector items).

That's correct. The shadow code is responsible for validating each insert of a Slice or Partition object. TI/TD is meant to be quite stupid. If the consumer doesn't check the errsvc, they may miss an overlapped child. get_gaps() is there as a convenience method for consumers.


You could sort self._children on child.start_sector and get rid of the
V_BACKUP child, then check the "child" pairs for overlap easily. Additionally you can get rid of the usage list entirely, which would simplify the loop at 255-267. In fact, the 241-246 and 255-267 loops could probably be combined and simplified together.

The get_gaps() methods have been rewritten a few times now (with another iteration to come). Take a look when we send out the second round of code.


243: Is there such a thing as a backup partition? (I know about a backup slice.)

No there's not.

Thanks, Jack!
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

Reply via email to