]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/acpi/acpica/nsalloc.c
ACPICA: Optimization: Reduce the number of namespace walks
[mv-sheeva.git] / drivers / acpi / acpica / nsalloc.c
index 8d3a43a061ab1214662b37932958c24ab4c26bd6..1e5ff803d9ad14ba678ba06fc4c28984995112eb 100644 (file)
@@ -219,12 +219,24 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp
 
        ACPI_FUNCTION_TRACE(ns_install_node);
 
-       /*
-        * Get the owner ID from the Walk state. The owner ID is used to track
-        * table deletion and deletion of objects created by methods.
-        */
        if (walk_state) {
+               /*
+                * Get the owner ID from the Walk state. The owner ID is used to
+                * track table deletion and deletion of objects created by methods.
+                */
                owner_id = walk_state->owner_id;
+
+               if ((walk_state->method_desc) &&
+                   (parent_node != walk_state->method_node)) {
+                       /*
+                        * A method is creating a new node that is not a child of the
+                        * method (it is non-local). Mark the executing method as having
+                        * modified the namespace. This is used for cleanup when the
+                        * method exits.
+                        */
+                       walk_state->method_desc->method.flags |=
+                           AOPOBJ_MODIFIED_NAMESPACE;
+               }
        }
 
        /* Link the new entry into the parent and existing children */