From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757720Ab0E1AeF (ORCPT ); Thu, 27 May 2010 20:34:05 -0400 Received: from TYO202.gate.nec.co.jp ([202.32.8.206]:47203 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756074Ab0E1AdC (ORCPT ); Thu, 27 May 2010 20:33:02 -0400 From: Naoya Horiguchi To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Andi Kleen , Andrew Morton , Wu Fengguang , Mel Gorman Subject: [PATCH 1/8] hugetlb: move definition of is_vm_hugetlb_page() to hugepage_inline.h Date: Fri, 28 May 2010 09:29:15 +0900 Message-Id: <1275006562-18946-2-git-send-email-n-horiguchi@ah.jp.nec.com> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1275006562-18946-1-git-send-email-n-horiguchi@ah.jp.nec.com> References: <1275006562-18946-1-git-send-email-n-horiguchi@ah.jp.nec.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Naoya Horiguchi --- include/linux/hugetlb.h | 11 +---------- include/linux/hugetlb_inline.h | 22 ++++++++++++++++++++++ include/linux/pagemap.h | 1 + 3 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 include/linux/hugetlb_inline.h diff --git v2.6.34/include/linux/hugetlb.h v2.6.34/include/linux/hugetlb.h index 78b4bc6..d47a7c4 100644 --- v2.6.34/include/linux/hugetlb.h +++ v2.6.34/include/linux/hugetlb.h @@ -2,6 +2,7 @@ #define _LINUX_HUGETLB_H #include +#include 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 v2.6.34/include/linux/hugetlb_inline.h v2.6.34/include/linux/hugetlb_inline.h new file mode 100644 index 0000000..cf00b6d --- /dev/null +++ v2.6.34/include/linux/hugetlb_inline.h @@ -0,0 +1,22 @@ +#ifndef _LINUX_HUGETLB_INLINE_H +#define _LINUX_HUGETLB_INLINE_H 1 + +#ifdef CONFIG_HUGETLBFS + +#include + +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 v2.6.34/include/linux/pagemap.h v2.6.34/include/linux/pagemap.h index 3c62ed4..b2bd2ba 100644 --- v2.6.34/include/linux/pagemap.h +++ v2.6.34/include/linux/pagemap.h @@ -13,6 +13,7 @@ #include #include #include /* for in_interrupt() */ +#include /* * Bits in mapping->flags. The lower __GFP_BITS_SHIFT bits are the page -- 1.7.0