|
@@ -312,6 +312,7 @@ static int get_nid_for_pfn(unsigned long pfn)
|
|
/* register memory section under specified node if it spans that node */
|
|
/* register memory section under specified node if it spans that node */
|
|
int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
|
|
int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
|
|
{
|
|
{
|
|
|
|
+ int ret;
|
|
unsigned long pfn, sect_start_pfn, sect_end_pfn;
|
|
unsigned long pfn, sect_start_pfn, sect_end_pfn;
|
|
|
|
|
|
if (!mem_blk)
|
|
if (!mem_blk)
|
|
@@ -328,9 +329,15 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid)
|
|
continue;
|
|
continue;
|
|
if (page_nid != nid)
|
|
if (page_nid != nid)
|
|
continue;
|
|
continue;
|
|
- return sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj,
|
|
|
|
|
|
+ ret = sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj,
|
|
&mem_blk->sysdev.kobj,
|
|
&mem_blk->sysdev.kobj,
|
|
kobject_name(&mem_blk->sysdev.kobj));
|
|
kobject_name(&mem_blk->sysdev.kobj));
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+
|
|
|
|
+ return sysfs_create_link_nowarn(&mem_blk->sysdev.kobj,
|
|
|
|
+ &node_devices[nid].sysdev.kobj,
|
|
|
|
+ kobject_name(&node_devices[nid].sysdev.kobj));
|
|
}
|
|
}
|
|
/* mem section does not span the specified node */
|
|
/* mem section does not span the specified node */
|
|
return 0;
|
|
return 0;
|
|
@@ -359,6 +366,8 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk)
|
|
continue;
|
|
continue;
|
|
sysfs_remove_link(&node_devices[nid].sysdev.kobj,
|
|
sysfs_remove_link(&node_devices[nid].sysdev.kobj,
|
|
kobject_name(&mem_blk->sysdev.kobj));
|
|
kobject_name(&mem_blk->sysdev.kobj));
|
|
|
|
+ sysfs_remove_link(&mem_blk->sysdev.kobj,
|
|
|
|
+ kobject_name(&node_devices[nid].sysdev.kobj));
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|