linux-kernel-detect-gfp-mask-in-struct-address-space-20020624
authorDerrick Brashear <shadow@dementia.org>
Tue, 25 Jun 2002 16:02:11 +0000 (16:02 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 25 Jun 2002 16:02:11 +0000 (16:02 +0000)
based on report that new redhat kernels need this

acconfig.h
acinclude.m4
src/afs/afs_vcache.c
src/cf/linux-test2.m4

index fa26c8e..913d07d 100644 (file)
@@ -30,6 +30,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #undef FULL_LISTVOL_SWITCH
 
 #undef INODE_SETATTR_NOT_VOID
+#undef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
 #undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
 #undef STRUCT_INODE_HAS_I_TRUNCATE_SEM
 #undef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
index 3d21292..db7ebfd 100644 (file)
@@ -135,6 +135,7 @@ case $system in
                   [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
                 )
                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
+                LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
                 LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
                 LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
                 LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
@@ -147,6 +148,9 @@ case $system in
                 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
                  AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK)
                 fi
+                if test "x$ac_cv_linux_fs_struct_address_space_has_gfp_mask" = "xyes"; then 
+                 AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_GFP_MASK)
+                fi
                 if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
                  AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM)
                 fi
index c97e9a9..a0824a1 100644 (file)
@@ -997,6 +997,9 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
        INIT_LIST_HEAD(&ip->i_devices);
 #endif
        ip->i_data.host = (void*) ip;
+#ifdef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
+       ip->i_data.gfp_mask = GFP_HIGHUSER;
+#endif
        ip->i_mapping = &ip->i_data;
 #ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM
        init_rwsem(&ip->i_truncate_sem);
index 6a6a9db..3451ed6 100644 (file)
@@ -1,3 +1,18 @@
+AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, [
+AC_MSG_CHECKING(for gfp_mask in struct address_space)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_gfp_mask, 
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct address_space _a;
+printf("%d\n", _a.gfp_mask);], 
+ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
+ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)
+CPPFLAGS="$save_CPPFLAGS"])
+
 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_BYTES, [
 AC_MSG_CHECKING(for i_bytes in struct inode)
 save_CPPFLAGS="$CPPFLAGS"