diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2010-05-28 09:29:15 +0900 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2010-08-11 09:20:41 +0200 |
commit | 8edf344c66a3f214d709dad1421c29d678915b3f (patch) | |
tree | 0b976d0c52ac5efddcd30c8cb60e44b2cc0029e2 | |
parent | 9fe6206f400646a2322096b56c59891d530e8d51 (diff) | |
download | kernel_samsung_crespo-8edf344c66a3f214d709dad1421c29d678915b3f.zip kernel_samsung_crespo-8edf344c66a3f214d709dad1421c29d678915b3f.tar.gz kernel_samsung_crespo-8edf344c66a3f214d709dad1421c29d678915b3f.tar.bz2 |
hugetlb: move definition of is_vm_hugetlb_page() to hugepage_inline.h
is_vm_hugetlb_page() is a widely used inline function to insert hooks
into hugetlb code.
But we can't use it in pagemap.h because of circular dependency of
the header files. This patch removes this limitation.
Acked-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r-- | include/linux/hugetlb.h | 11 | ||||
-rw-r--r-- | include/linux/hugetlb_inline.h | 22 | ||||
-rw-r--r-- | include/linux/pagemap.h | 1 |
3 files changed, 24 insertions, 10 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 78b4bc6..d47a7c4 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -2,6 +2,7 @@ #define _LINUX_HUGETLB_H #include <linux/fs.h> +#include <linux/hugetlb_inline.h> struct ctl_table; struct user_struct; @@ -14,11 +15,6 @@ struct user_struct; int PageHuge(struct page *page); -static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) -{ - return vma->vm_flags & VM_HUGETLB; -} - void reset_vma_resv_huge_pages(struct vm_area_struct *vma); int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); @@ -77,11 +73,6 @@ static inline int PageHuge(struct page *page) return 0; } -static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) -{ - return 0; -} - static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) { } diff --git a/include/linux/hugetlb_inline.h b/include/linux/hugetlb_inline.h new file mode 100644 index 0000000..cf00b6d --- /dev/null +++ b/include/linux/hugetlb_inline.h @@ -0,0 +1,22 @@ +#ifndef _LINUX_HUGETLB_INLINE_H +#define _LINUX_HUGETLB_INLINE_H 1 + +#ifdef CONFIG_HUGETLBFS + +#include <linux/mm.h> + +static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) +{ + return vma->vm_flags & VM_HUGETLB; +} + +#else + +static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) +{ + return 0; +} + +#endif + +#endif diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 3c62ed4..b2bd2ba 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -13,6 +13,7 @@ #include <linux/gfp.h> #include <linux/bitops.h> #include <linux/hardirq.h> /* for in_interrupt() */ +#include <linux/hugetlb_inline.h> /* * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page |