aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 2316840b337a..7acd12503f73 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1592,9 +1592,9 @@ static void __init hugetlb_sysfs_init(void)
1592 1592
1593/* 1593/*
1594 * node_hstate/s - associate per node hstate attributes, via their kobjects, 1594 * node_hstate/s - associate per node hstate attributes, via their kobjects,
1595 * with node sysdevs in node_devices[] using a parallel array. The array 1595 * with node devices in node_devices[] using a parallel array. The array
1596 * index of a node sysdev or _hstate == node id. 1596 * index of a node device or _hstate == node id.
1597 * This is here to avoid any static dependency of the node sysdev driver, in 1597 * This is here to avoid any static dependency of the node device driver, in
1598 * the base kernel, on the hugetlb module. 1598 * the base kernel, on the hugetlb module.
1599 */ 1599 */
1600struct node_hstate { 1600struct node_hstate {
@@ -1604,7 +1604,7 @@ struct node_hstate {
1604struct node_hstate node_hstates[MAX_NUMNODES]; 1604struct node_hstate node_hstates[MAX_NUMNODES];
1605 1605
1606/* 1606/*
1607 * A subset of global hstate attributes for node sysdevs 1607 * A subset of global hstate attributes for node devices
1608 */ 1608 */
1609static struct attribute *per_node_hstate_attrs[] = { 1609static struct attribute *per_node_hstate_attrs[] = {
1610 &nr_hugepages_attr.attr, 1610 &nr_hugepages_attr.attr,
@@ -1618,7 +1618,7 @@ static struct attribute_group per_node_hstate_attr_group = {
1618}; 1618};
1619 1619
1620/* 1620/*
1621 * kobj_to_node_hstate - lookup global hstate for node sysdev hstate attr kobj. 1621 * kobj_to_node_hstate - lookup global hstate for node device hstate attr kobj.
1622 * Returns node id via non-NULL nidp. 1622 * Returns node id via non-NULL nidp.
1623 */ 1623 */
1624static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp) 1624static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp)
@@ -1641,13 +1641,13 @@ static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp)
1641} 1641}
1642 1642
1643/* 1643/*
1644 * Unregister hstate attributes from a single node sysdev. 1644 * Unregister hstate attributes from a single node device.
1645 * No-op if no hstate attributes attached. 1645 * No-op if no hstate attributes attached.
1646 */ 1646 */
1647void hugetlb_unregister_node(struct node *node) 1647void hugetlb_unregister_node(struct node *node)
1648{ 1648{
1649 struct hstate *h; 1649 struct hstate *h;
1650 struct node_hstate *nhs = &node_hstates[node->sysdev.id]; 1650 struct node_hstate *nhs = &node_hstates[node->dev.id];
1651 1651
1652 if (!nhs->hugepages_kobj) 1652 if (!nhs->hugepages_kobj)
1653 return; /* no hstate attributes */ 1653 return; /* no hstate attributes */
@@ -1663,7 +1663,7 @@ void hugetlb_unregister_node(struct node *node)
1663} 1663}
1664 1664
1665/* 1665/*
1666 * hugetlb module exit: unregister hstate attributes from node sysdevs 1666 * hugetlb module exit: unregister hstate attributes from node devices
1667 * that have them. 1667 * that have them.
1668 */ 1668 */
1669static void hugetlb_unregister_all_nodes(void) 1669static void hugetlb_unregister_all_nodes(void)
@@ -1671,7 +1671,7 @@ static void hugetlb_unregister_all_nodes(void)
1671 int nid; 1671 int nid;
1672 1672
1673 /* 1673 /*
1674 * disable node sysdev registrations. 1674 * disable node device registrations.
1675 */ 1675 */
1676 register_hugetlbfs_with_node(NULL, NULL); 1676 register_hugetlbfs_with_node(NULL, NULL);
1677 1677
@@ -1683,20 +1683,20 @@ static void hugetlb_unregister_all_nodes(void)
1683} 1683}
1684 1684
1685/* 1685/*
1686 * Register hstate attributes for a single node sysdev. 1686 * Register hstate attributes for a single node device.
1687 * No-op if attributes already registered. 1687 * No-op if attributes already registered.
1688 */ 1688 */
1689void hugetlb_register_node(struct node *node) 1689void hugetlb_register_node(struct node *node)
1690{ 1690{
1691 struct hstate *h; 1691 struct hstate *h;
1692 struct node_hstate *nhs = &node_hstates[node->sysdev.id]; 1692 struct node_hstate *nhs = &node_hstates[node->dev.id];
1693 int err; 1693 int err;
1694 1694
1695 if (nhs->hugepages_kobj) 1695 if (nhs->hugepages_kobj)
1696 return; /* already allocated */ 1696 return; /* already allocated */
1697 1697
1698 nhs->hugepages_kobj = kobject_create_and_add("hugepages", 1698 nhs->hugepages_kobj = kobject_create_and_add("hugepages",
1699 &node->sysdev.kobj); 1699 &node->dev.kobj);
1700 if (!nhs->hugepages_kobj) 1700 if (!nhs->hugepages_kobj)
1701 return; 1701 return;
1702 1702
@@ -1707,7 +1707,7 @@ void hugetlb_register_node(struct node *node)
1707 if (err) { 1707 if (err) {
1708 printk(KERN_ERR "Hugetlb: Unable to add hstate %s" 1708 printk(KERN_ERR "Hugetlb: Unable to add hstate %s"
1709 " for node %d\n", 1709 " for node %d\n",
1710 h->name, node->sysdev.id); 1710 h->name, node->dev.id);
1711 hugetlb_unregister_node(node); 1711 hugetlb_unregister_node(node);
1712 break; 1712 break;
1713 } 1713 }
@@ -1716,8 +1716,8 @@ void hugetlb_register_node(struct node *node)
1716 1716
1717/* 1717/*
1718 * hugetlb init time: register hstate attributes for all registered node 1718 * hugetlb init time: register hstate attributes for all registered node
1719 * sysdevs of nodes that have memory. All on-line nodes should have 1719 * devices of nodes that have memory. All on-line nodes should have
1720 * registered their associated sysdev by this time. 1720 * registered their associated device by this time.
1721 */ 1721 */
1722static void hugetlb_register_all_nodes(void) 1722static void hugetlb_register_all_nodes(void)
1723{ 1723{
@@ -1725,12 +1725,12 @@ static void hugetlb_register_all_nodes(void)
1725 1725
1726 for_each_node_state(nid, N_HIGH_MEMORY) { 1726 for_each_node_state(nid, N_HIGH_MEMORY) {
1727 struct node *node = &node_devices[nid]; 1727 struct node *node = &node_devices[nid];
1728 if (node->sysdev.id == nid) 1728 if (node->dev.id == nid)
1729 hugetlb_register_node(node); 1729 hugetlb_register_node(node);
1730 } 1730 }
1731 1731
1732 /* 1732 /*
1733 * Let the node sysdev driver know we're here so it can 1733 * Let the node device driver know we're here so it can
1734 * [un]register hstate attributes on node hotplug. 1734 * [un]register hstate attributes on node hotplug.
1735 */ 1735 */
1736 register_hugetlbfs_with_node(hugetlb_register_node, 1736 register_hugetlbfs_with_node(hugetlb_register_node,