Patch by Bryce Groff: Implemented DeleteChild().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31235 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -364,6 +364,7 @@ PartitionMapHandle::ValidateCreateChild(off_t* _offset, off_t* _size,
|
|||||||
PartitionType type;
|
PartitionType type;
|
||||||
if (!type.SetType(typeString) || type.IsEmpty())
|
if (!type.SetType(typeString) || type.IsEmpty())
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
if (type.IsExtended() && fPartitionMap.ExtendedPartitionIndex() >= 0)
|
if (type.IsExtended() && fPartitionMap.ExtendedPartitionIndex() >= 0)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
@@ -556,3 +557,13 @@ PartitionMapHandle::CreateChild(off_t offset, off_t size,
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DeleteChild
|
||||||
|
status_t
|
||||||
|
PartitionMapHandle::DeleteChild(BMutablePartition* child)
|
||||||
|
{
|
||||||
|
BMutablePartition* parent = child->Parent();
|
||||||
|
status_t error = parent->DeleteChild(child);
|
||||||
|
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public:
|
|||||||
const char* type, const char* name,
|
const char* type, const char* name,
|
||||||
const char* parameters,
|
const char* parameters,
|
||||||
BMutablePartition** child);
|
BMutablePartition** child);
|
||||||
|
virtual status_t DeleteChild(BMutablePartition* child);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PartitionMap fPartitionMap;
|
PartitionMap fPartitionMap;
|
||||||
|
|||||||
Reference in New Issue
Block a user