LINUX: correct include for ktime_get_coarse_real_ts64()
[openafs.git] / src / cf / linux-kernel-func.m4
1 AC_DEFUN([OPENAFS_LINUX_KERNEL_FUNC_CHECKS],[
2 dnl Function existence checks
3 AC_CHECK_LINUX_FUNC([__vfs_write],
4                     [#include <linux/fs.h>],
5                     [__vfs_write(NULL, NULL, 0, NULL);])
6 AC_CHECK_LINUX_FUNC([kernel_write],
7                     [#include <linux/fs.h>],
8                     [kernel_write(NULL, NULL, 0, NULL);])
9 AC_CHECK_LINUX_FUNC([bdi_init],
10                     [#include <linux/backing-dev.h>],
11                     [bdi_init(NULL);])
12 AC_CHECK_LINUX_FUNC([super_setup_bdi],
13                     [#include <linux/backing-dev.h>],
14                     [struct super_block *sb;
15                      super_setup_bdi(sb);])
16 AC_CHECK_LINUX_FUNC([PageChecked],
17                     [#include <linux/mm.h>
18                      #include <linux/page-flags.h>],
19                     [struct page *_page;
20                      int bchecked = PageChecked(_page);])
21 AC_CHECK_LINUX_FUNC([PageFsMisc],
22                     [#include <linux/mm.h>
23                      #include <linux/page-flags.h>],
24                     [struct page *_page;
25                      int bchecked = PageFsMisc(_page);])
26 AC_CHECK_LINUX_FUNC([clear_inode],
27                     [#include <linux/fs.h>],
28                     [clear_inode(NULL);])
29 AC_CHECK_LINUX_FUNC([current_kernel_time],
30                     [#include <linux/time.h>],
31                     [struct timespec s;
32                      s = current_kernel_time();])
33 AC_CHECK_LINUX_FUNC([d_alloc_anon],
34                     [#include <linux/fs.h>],
35                     [d_alloc_anon(NULL);])
36 AC_CHECK_LINUX_FUNC([d_count],
37                     [#include <linux/dcache.h>],
38                     [d_count(NULL);])
39 AC_CHECK_LINUX_FUNC([d_make_root],
40                     [#include <linux/fs.h>],
41                     [d_make_root(NULL);])
42 AC_CHECK_LINUX_FUNC([do_sync_read],
43                     [#include <linux/fs.h>],
44                     [do_sync_read(NULL, NULL, 0, NULL);])
45 AC_CHECK_LINUX_FUNC([file_dentry],
46                     [#include <linux/fs.h>],
47                     [struct file *f; file_dentry(f);])
48 AC_CHECK_LINUX_FUNC([find_task_by_pid],
49                     [#include <linux/sched.h>],
50                     [pid_t p; find_task_by_pid(p);])
51 AC_CHECK_LINUX_FUNC([generic_file_aio_read],
52                     [#include <linux/fs.h>],
53                     [generic_file_aio_read(NULL,NULL,0,0);])
54 AC_CHECK_LINUX_FUNC([grab_cache_page_write_begin],
55                     [#include <linux/pagemap.h>],
56                     [grab_cache_page_write_begin(NULL, 0, 0);])
57 AC_CHECK_LINUX_FUNC([hlist_unhashed],
58                     [#include <linux/list.h>],
59                     [hlist_unhashed(0);])
60 AC_CHECK_LINUX_FUNC([ihold],
61                     [#include <linux/fs.h>],
62                     [ihold(NULL);])
63 AC_CHECK_LINUX_FUNC([i_size_read],
64                     [#include <linux/fs.h>],
65                     [i_size_read(NULL);])
66 AC_CHECK_LINUX_FUNC([inode_setattr],
67                     [#include <linux/fs.h>],
68                     [inode_setattr(NULL, NULL);])
69 AC_CHECK_LINUX_FUNC([iter_file_splice_write],
70                     [#include <linux/fs.h>],
71                     [iter_file_splice_write(NULL,NULL,NULL,0,0);])
72 AC_CHECK_LINUX_FUNC([kernel_setsockopt],
73                     [#include <linux/net.h>],
74                     [kernel_setsockopt(NULL, 0, 0, NULL, 0);])
75 AC_CHECK_LINUX_FUNC([ktime_get_coarse_real_ts64],
76                     [#include <linux/ktime.h>],
77                     [struct timespec64 *s;
78                     ktime_get_coarse_real_ts64(s);])
79 AC_CHECK_LINUX_FUNC([locks_lock_file_wait],
80                     [#include <linux/fs.h>],
81                     [locks_lock_file_wait(NULL, NULL);])
82 AC_CHECK_LINUX_FUNC([page_follow_link],
83                     [#include <linux/fs.h>],
84                     [page_follow_link(0,0);])
85 AC_CHECK_LINUX_FUNC([page_get_link],
86                     [#include <linux/fs.h>],
87                     [page_get_link(0,0,0);])
88 AC_CHECK_LINUX_FUNC([page_offset],
89                     [#include <linux/pagemap.h>],
90                     [page_offset(NULL);])
91 AC_CHECK_LINUX_FUNC([pagevec_lru_add_file],
92                     [#include <linux/pagevec.h>],
93                     [__pagevec_lru_add_file(NULL);])
94 AC_CHECK_LINUX_FUNC([path_lookup],
95                     [#include <linux/fs.h>
96                      #include <linux/namei.h>],
97                     [path_lookup(NULL, 0, NULL);])
98 AC_CHECK_LINUX_FUNC([proc_create],
99                     [#include <linux/proc_fs.h>],
100                     [proc_create(NULL, 0, NULL, NULL);])
101 AC_CHECK_LINUX_FUNC([rcu_read_lock],
102                     [#include <linux/rcupdate.h>],
103                     [rcu_read_lock();])
104 AC_CHECK_LINUX_FUNC([set_nlink],
105                     [#include <linux/fs.h>],
106                     [set_nlink(NULL, 1);])
107 AC_CHECK_LINUX_FUNC([setattr_prepare],
108                     [#include <linux/fs.h>],
109                     [setattr_prepare(NULL, NULL);])
110 AC_CHECK_LINUX_FUNC([sock_create_kern],
111                     [#include <linux/net.h>],
112                     [sock_create_kern(0, 0, 0, NULL);])
113 AC_CHECK_LINUX_FUNC([sock_create_kern_ns],
114                     [#include <linux/net.h>],
115                     [sock_create_kern(NULL, 0, 0, 0, NULL);])
116 AC_CHECK_LINUX_FUNC([splice_direct_to_actor],
117                     [#include <linux/splice.h>],
118                     [splice_direct_to_actor(NULL,NULL,NULL);])
119 AC_CHECK_LINUX_FUNC([default_file_splice_read],
120                     [#include <linux/fs.h>],
121                     [default_file_splice_read(NULL,NULL,NULL, 0, 0);])
122 AC_CHECK_LINUX_FUNC([svc_addr_in],
123                     [#include <linux/sunrpc/svc.h>],
124                     [svc_addr_in(NULL);])
125 AC_CHECK_LINUX_FUNC([zero_user_segments],
126                     [#include <linux/highmem.h>],
127                     [zero_user_segments(NULL, 0, 0, 0, 0);])
128 AC_CHECK_LINUX_FUNC([noop_fsync],
129                     [#include <linux/fs.h>],
130                     [void *address = &noop_fsync; printk("%p\n", address)];)
131 AC_CHECK_LINUX_FUNC([kthread_run],
132                     [#include <linux/kernel.h>
133                      #include <linux/kthread.h>],
134                     [kthread_run(NULL, NULL, "test");])
135 AC_CHECK_LINUX_FUNC([inode_nohighmem],
136                     [#include <linux/fs.h>],
137                     [inode_nohighmem(NULL);])
138 AC_CHECK_LINUX_FUNC([inode_lock],
139                     [#include <linux/fs.h>],
140                     [inode_lock(NULL);])
141
142 dnl Consequences - things which get set as a result of the
143 dnl                above tests
144 AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"],
145     [AC_DEFINE([AFS_NONFSTRANS], 1,
146         [define to disable the nfs translator])])
147 ])