aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2012-07-31 19:42:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:42:40 -0400
commitc3f38a38715e9b4e7b1dda6840a1375f6894744d (patch)
treea351f014cc5e4483a9f5498b7086783b0fcb5bdd
parent0edaecfab218d747d30de4575e911907371e2cd2 (diff)
hugetlb: make some static variables global
We will use them later in hugetlb_cgroup.c Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: David Rientjes <rientjes@google.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Hillf Danton <dhillf@gmail.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/hugetlb.h5
-rw-r--r--mm/hugetlb.c7
2 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index ed550d819044..3d677dd41898 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -21,6 +21,11 @@ struct hugepage_subpool {
21 long max_hpages, used_hpages; 21 long max_hpages, used_hpages;
22}; 22};
23 23
24extern spinlock_t hugetlb_lock;
25extern int hugetlb_max_hstate __read_mostly;
26#define for_each_hstate(h) \
27 for ((h) = hstates; (h) < &hstates[hugetlb_max_hstate]; (h)++)
28
24struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); 29struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
25void hugepage_put_subpool(struct hugepage_subpool *spool); 30void hugepage_put_subpool(struct hugepage_subpool *spool);
26 31
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index b5b6e156ca76..d5971597736b 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -35,7 +35,7 @@ const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;
35static gfp_t htlb_alloc_mask = GFP_HIGHUSER; 35static gfp_t htlb_alloc_mask = GFP_HIGHUSER;
36unsigned long hugepages_treat_as_movable; 36unsigned long hugepages_treat_as_movable;
37 37
38static int hugetlb_max_hstate; 38int hugetlb_max_hstate __read_mostly;
39unsigned int default_hstate_idx; 39unsigned int default_hstate_idx;
40struct hstate hstates[HUGE_MAX_HSTATE]; 40struct hstate hstates[HUGE_MAX_HSTATE];
41 41
@@ -46,13 +46,10 @@ static struct hstate * __initdata parsed_hstate;
46static unsigned long __initdata default_hstate_max_huge_pages; 46static unsigned long __initdata default_hstate_max_huge_pages;
47static unsigned long __initdata default_hstate_size; 47static unsigned long __initdata default_hstate_size;
48 48
49#define for_each_hstate(h) \
50 for ((h) = hstates; (h) < &hstates[hugetlb_max_hstate]; (h)++)
51
52/* 49/*
53 * Protects updates to hugepage_freelists, nr_huge_pages, and free_huge_pages 50 * Protects updates to hugepage_freelists, nr_huge_pages, and free_huge_pages
54 */ 51 */
55static DEFINE_SPINLOCK(hugetlb_lock); 52DEFINE_SPINLOCK(hugetlb_lock);
56 53
57static inline void unlock_or_release_subpool(struct hugepage_subpool *spool) 54static inline void unlock_or_release_subpool(struct hugepage_subpool *spool)
58{ 55{