loader: Drop the HashMap for partition lookup by id
The HashMap constructor was called before the heap is initialized, ending up calling malloc from the OpenHashMap constructor. Oddly it was still working on x86 but broke other platforms. Instead we add a Lookup() static method to Partition, which by default walks gPartitions for the id, and recursively calls itself on the children lists. This means we must add a partition even temporarily to gPartitions before Scan()ing it though. Signed-off-by: François Revol <[email protected]>
This commit is contained in:
committed by
Jessica Hamilton
parent
735f1daee9
commit
495efc382b
@@ -30,6 +30,8 @@ class Partition : public Node, public partition_data {
|
||||
status_t Mount(Directory **_fileSystem = NULL, bool isBootDevice = false);
|
||||
status_t Scan(bool mountFileSystems, bool isBootDevice = false);
|
||||
|
||||
static Partition *Lookup(partition_id id, NodeList *list = NULL);
|
||||
|
||||
void SetParent(Partition *parent);
|
||||
Partition *Parent() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user