Skip to content

Commit 8a21346

Browse files
Nishanth Aravamudantorvalds
authored andcommitted
hugetlb: fix CONFIG_SYSCTL=n build
Fixes a build failure reported by Alan Cox: mm/hugetlb.c: In function `hugetlb_acct_memory': mm/hugetlb.c:1507: error: implicit declaration of function `cpuset_mems_nr' Also reverts Ingo's commit e44d1b2 Author: Ingo Molnar <mingo@elte.hu> Date: Fri Jul 25 12:57:41 2008 +0200 mm/hugetlb.c: fix build failure with !CONFIG_SYSCTL which fixed the build error but added some unused-static-function warnings. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 16d6926 commit 8a21346

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎mm/hugetlb.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,18 +1026,6 @@ static void __init report_hugepages(void)
10261026
}
10271027
}
10281028

1029-
static unsigned int cpuset_mems_nr(unsigned int *array)
1030-
{
1031-
int node;
1032-
unsigned int nr = 0;
1033-
1034-
for_each_node_mask(node, cpuset_current_mems_allowed)
1035-
nr += array[node];
1036-
1037-
return nr;
1038-
}
1039-
1040-
#ifdef CONFIG_SYSCTL
10411029
#ifdef CONFIG_HIGHMEM
10421030
static void try_to_free_low(struct hstate *h, unsigned long count)
10431031
{
@@ -1386,6 +1374,18 @@ static int __init hugetlb_default_setup(char *s)
13861374
}
13871375
__setup("default_hugepagesz=", hugetlb_default_setup);
13881376

1377+
static unsigned int cpuset_mems_nr(unsigned int *array)
1378+
{
1379+
int node;
1380+
unsigned int nr = 0;
1381+
1382+
for_each_node_mask(node, cpuset_current_mems_allowed)
1383+
nr += array[node];
1384+
1385+
return nr;
1386+
}
1387+
1388+
#ifdef CONFIG_SYSCTL
13891389
int hugetlb_sysctl_handler(struct ctl_table *table, int write,
13901390
struct file *file, void __user *buffer,
13911391
size_t *length, loff_t *ppos)

0 commit comments

Comments
 (0)