From c3c2bc80a6ff798467684f1805093d715c92e6b4 Mon Sep 17 00:00:00 2001 From: green Date: Wed, 19 Oct 2005 18:58:42 +0000 Subject: [PATCH] b=9482 r=adilger Check that there is no page_mapped() before trying to define it for 2.4 kernels. --- lustre/autoconf/lustre-core.m4 | 16 ++++++++++++++++ lustre/include/linux/lustre_compat25.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index b77ce5f..5b48d1c 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -414,6 +414,21 @@ LB_LINUX_TRY_COMPILE([ ]) ]) +AC_DEFUN([LC_FUNC_PAGE_MAPPED], +[AC_MSG_CHECKING([if kernel offers page_mapped]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + page_mapped(NULL); +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_PAGE_MAPPED, 1, [page_mapped found]) +],[ + AC_MSG_RESULT([no]) +]) +]) + + # # LC_PROG_LINUX # @@ -437,6 +452,7 @@ LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP LC_FUNC_DEV_SET_RDONLY LC_FUNC_FILEMAP_FDATAWRITE LC_STRUCT_STATFS +LC_FUNC_PAGE_MAPPED ]) # diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 86430bf..e5260f1 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -287,6 +287,7 @@ static inline int mapping_mapped(struct address_space *mapping) #define ll_zap_page_range(vma, addr, len) zap_page_range(vma->vm_mm, addr, len) #endif +#ifndef HAVE_PAGE_MAPPED /* Poor man's page_mapped. substract from page count, counts from buffers/pagecache and our own count (we are supposed to hold one reference). What is left are user mappings and also others who work with this page now, @@ -295,6 +296,7 @@ static inline int page_mapped(struct page *page) { return page_count(page) - !!page->mapping - !!page->buffers - 1; } +#endif /* !HAVE_PAGE_MAPPED */ #endif /* end of 2.4 compat macros */ -- 1.8.3.1