/** * unregister_node - unregister a node device * @node: node going away * * Unregisters a node device @node. All the devices on the node must be * unregistered before calling this function. */ void unregister_node(struct node *node) { device_remove_file(&node->dev, &dev_attr_cpumap); device_remove_file(&node->dev, &dev_attr_cpulist); device_remove_file(&node->dev, &dev_attr_meminfo); device_remove_file(&node->dev, &dev_attr_numastat); device_remove_file(&node->dev, &dev_attr_distance); device_remove_file(&node->dev, &dev_attr_vmstat); hugetlb_unregister_node(node); /* no-op, if memoryless node */ device_unregister(&node->dev); }
/** * unregister_node - unregister a node device * @node: node going away * * Unregisters a node device @node. All the devices on the node must be * unregistered before calling this function. */ void unregister_node(struct node *node) { sysdev_remove_file(&node->sysdev, &attr_cpumap); sysdev_remove_file(&node->sysdev, &attr_cpulist); sysdev_remove_file(&node->sysdev, &attr_meminfo); sysdev_remove_file(&node->sysdev, &attr_numastat); sysdev_remove_file(&node->sysdev, &attr_distance); scan_unevictable_unregister_node(node); hugetlb_unregister_node(node); /* no-op, if memoryless node */ sysdev_unregister(&node->sysdev); }
/* * Handle per node hstate attribute [un]registration on transistions * to/from memoryless state. */ static void node_hugetlb_work(struct work_struct *work) { struct node *node = container_of(work, struct node, node_work); /* * We only get here when a node transitions to/from memoryless state. * We can detect which transition occurred by examining whether the * node has memory now. hugetlb_register_node() already check this * so we try to register the attributes. If that fails, then the * node has transitioned to memoryless, try to unregister the * attributes. */ if (!hugetlb_register_node(node)) hugetlb_unregister_node(node); }
/** * unregister_node - unregister a node device * @node: node going away * * Unregisters a node device @node. All the devices on the node must be * unregistered before calling this function. */ void unregister_node(struct node *node) { hugetlb_unregister_node(node); /* no-op, if memoryless node */ device_unregister(&node->dev); }