Add root node optimization to internal get namespace node function.

Detect a request for the root node (a lone backslash) up front before
invoking a full namespace lookup.
This commit is contained in:
Robert Moore 2012-11-15 12:59:12 -08:00
parent 29e066e019
commit 93f9f86221

View File

@ -855,6 +855,8 @@ AcpiNsGetNode (
ACPI_FUNCTION_TRACE_PTR (NsGetNode, ACPI_CAST_PTR (char, Pathname));
/* Simplest case is a null pathname */
if (!Pathname)
{
*ReturnNode = PrefixNode;
@ -865,6 +867,14 @@ AcpiNsGetNode (
return_ACPI_STATUS (AE_OK);
}
/* Quick check for a reference to the root */
if (ACPI_IS_ROOT_PREFIX (Pathname[0]) && (!Pathname[1]))
{
*ReturnNode = AcpiGbl_RootNode;
return_ACPI_STATUS (AE_OK);
}
/* Convert path to internal representation */
Status = AcpiNsInternalizeName (Pathname, &InternalPath);