* Added some hopefully helpful comments.

* Replaced my bogus comment that Ingo pointed out with a description that
  mentions LogicalPartitions also being used to describe so called "inner
  extended" partitions, which are only needed to point to the next PTS.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27624 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-09-18 14:56:49 +00:00
parent e73923b0c2
commit aecd884e05
2 changed files with 31 additions and 17 deletions
@@ -576,14 +576,16 @@ LogicalPartition::SetTo(const partition_descriptor *descriptor,
{
Unset();
if (descriptor && primary) {
// TODO: I am wondering if this is wrong, since it always uses the
// offset of the primary partition as base offset, even for
// logical partitions that come much later in the chain. For each,
// PTS in the chain of logical partitions, there should be one
// extended and one non-extended in the four possible table entries.
// So baseOffset would be wrong for all but the first three? The
// forth logical partition, assuming it's the extended one, would
// get a wrong baseOffset.
// There are two types of LogicalPartitions. There are so called
// "inner extended" partitions and the "real" logical partitions
// which contain data. The "inner extended" partitions don't contain
// data and are only used to point to the next PTS in the linked
// list of logical partitions. For "inner extended" partitions,
// the baseOffset is in relation to the (first sector of the)
// "primary extended" partition, in another words, all inner extended
// partitions use the same base offset for reference.
// The data containing, real logical partitions use the offset of the
// PTS that contains their partition descriptor as their baseOffset.
off_t baseOffset = (descriptor->is_extended() ? primary->Offset()
: ptsOffset);
Partition::SetTo(descriptor, ptsOffset, baseOffset);