6902d33f55f01af0e6c3c9f2282e7b9d6a4d4b81
[openafs.git] / src / cf / linux-test1.m4
1 AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE],[
2 AC_MSG_CHECKING(for inode_setattr return type)
3 save_CPPFLAGS="$CPPFLAGS"
4 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
5 AC_CACHE_VAL(ac_cv_linux_func_inode_setattr_returns_int,
6 [
7 AC_TRY_COMPILE(
8 [#include <linux/fs.h>],
9 [struct inode _inode; 
10 struct iattr _iattr;
11 int i; 
12 i = inode_setattr(&_inode, &_iattr);], 
13 ac_cv_linux_func_inode_setattr_returns_int=yes,
14 ac_cv_linux_func_inode_setattr_returns_int=no)])
15 AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)
16 CPPFLAGS="$save_CPPFLAGS"])
17
18 AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE],[
19 AC_MSG_CHECKING(for write_inode return type)
20 save_CPPFLAGS="$CPPFLAGS"
21 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
22 AC_CACHE_VAL(ac_cv_linux_func_write_inode_returns_int,
23 [
24 AC_TRY_COMPILE(
25 [#include <linux/fs.h>],
26 [struct inode _inode; 
27 struct super_operations _sops;
28 int i; 
29 i = _sops.write_inode(&_inode, 0);], 
30 ac_cv_linux_func_write_inode_returns_int=yes,
31 ac_cv_linux_func_write_inode_returns_int=no)])
32 AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)
33 CPPFLAGS="$save_CPPFLAGS"])
34
35 AC_DEFUN([LINUX_IOP_NAMEIDATA],[
36 save_CPPFLAGS="$CPPFLAGS"
37 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
38 AC_MSG_CHECKING(whether inode_operations.create takes a nameidata)
39 AC_CACHE_VAL(ac_cv_linux_func_i_create_takes_nameidata,
40 [
41 AC_TRY_COMPILE(
42 [#include <linux/fs.h>
43 #include <linux/namei.h>],
44 [struct inode _inode; 
45 struct dentry _dentry;
46 struct nameidata _nameidata;
47 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
48 ac_cv_linux_func_i_create_takes_nameidata=yes,
49 ac_cv_linux_func_i_create_takes_nameidata=no)])
50 AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)
51 if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
52 AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument])
53 fi
54 AC_MSG_CHECKING(whether inode_operations.lookup takes a nameidata)
55 AC_CACHE_VAL(ac_cv_linux_func_i_lookup_takes_nameidata,
56 [
57 AC_TRY_COMPILE(
58 [#include <linux/fs.h>
59 #include <linux/namei.h>],
60 [struct inode _inode; 
61 struct dentry _dentry;
62 struct nameidata _nameidata;
63 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
64 ac_cv_linux_func_i_lookup_takes_nameidata=yes,
65 ac_cv_linux_func_i_lookup_takes_nameidata=no)])
66 AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)
67 if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
68 AC_DEFINE(IOP_LOOKUP_TAKES_NAMEIDATA, 1, [define if your iops.lookup takes a nameidata argument])
69 fi
70 AC_MSG_CHECKING(whether inode_operations.permission takes a nameidata)
71 AC_CACHE_VAL(ac_cv_linux_func_i_permission_takes_nameidata,
72 [
73 AC_TRY_COMPILE(
74 [#include <linux/fs.h>
75 #include <linux/namei.h>],
76 [struct inode _inode; 
77 struct nameidata _nameidata;
78 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
79 ac_cv_linux_func_i_permission_takes_nameidata=yes,
80 ac_cv_linux_func_i_permission_takes_nameidata=no)])
81 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)
82 if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
83 AC_DEFINE(IOP_PERMISSION_TAKES_NAMEIDATA, 1, [define if your iops.permission takes a nameidata argument])
84 fi
85 AC_MSG_CHECKING(whether dentry_operations.d_revalidate takes a nameidata)
86 CPPFLAGS="$CPPFLAGS -Werror"
87 AC_CACHE_VAL(ac_cv_linux_func_d_revalidate_takes_nameidata,
88 [
89 AC_TRY_COMPILE(
90 [#include <linux/fs.h>
91 #include <linux/namei.h>],
92 [struct dentry _dentry; 
93 struct nameidata _nameidata;
94 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
95 ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
96 ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
97 AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)
98 if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
99   AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
100 fi
101 CPPFLAGS="$save_CPPFLAGS"])
102
103 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL],[
104 save_CPPFLAGS="$CPPFLAGS"
105 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
106 AC_MSG_CHECKING(whether address_space_operations.writepage takes a writeback_control)
107 AC_CACHE_VAL(ac_cv_linux_func_a_writepage_takes_writeback_control,
108 [
109 AC_TRY_COMPILE(
110 [#include <linux/fs.h>
111 #include <linux/mm.h>
112 #include <linux/writeback.h>],
113 [struct address_space_operations _aops; 
114 struct page _page;
115 struct writeback_control _writeback_control;
116 (void)_aops.writepage(&_page, &_writeback_control);],
117 ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
118 ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
119 AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)
120 if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
121 AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument])
122 fi
123 CPPFLAGS="$save_CPPFLAGS"])
124
125 AC_DEFUN([LINUX_REFRIGERATOR],[
126 save_CPPFLAGS="$CPPFLAGS"
127 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
128 AC_MSG_CHECKING(whether refrigerator takes PF_FREEZE)
129 AC_CACHE_VAL(ac_cv_linux_func_refrigerator_takes_pf_freeze,
130 [
131 AC_TRY_COMPILE(
132 [#include <linux/sched.h>],
133 [
134 refrigerator(PF_FREEZE);
135 ],
136 ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
137 ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
138 AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)
139 if test "x$ac_cv_linux_func_refrigerator_takes_pf_freeze" = "xyes" ; then
140 AC_DEFINE(LINUX_REFRIGERATOR_TAKES_PF_FREEZE, 1, [define if your refrigerator takes PF_FREEZE])
141 fi
142 CPPFLAGS="$save_CPPFLAGS"])