linux-new-aop-20081108
[openafs.git] / src / cf / linux-test4.m4
index f14d5f8..6b24ce5 100644 (file)
@@ -1024,3 +1024,96 @@ AC_DEFUN([LINUX_EXPORTS_RCU_READ_LOCK], [
     AC_DEFINE([EXPORTED_RCU_READ_LOCK], 1, [define if rcu_read_lock() is usable])
   fi])
  
+AC_DEFUN([LINUX_EXPORTS_FIND_TASK_BY_PID], [
+  AC_MSG_CHECKING([if find_task_by_pid is usable])
+  AC_CACHE_VAL([ac_cv_linux_exports_find_task_by_pid], [
+    AC_TRY_KBUILD(
+[#include <linux/sched.h>],
+[pid_t p;
+find_task_by_pid(p);],
+      ac_cv_linux_exports_find_task_by_pid=yes,
+      ac_cv_linux_exports_find_task_by_pid=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_find_task_by_pid)
+  if test "x$ac_cv_linux_exports_find_task_by_pid" = "xyes"; then
+    AC_DEFINE([EXPORTED_FIND_TASK_BY_PID], 1, [define if find_task_by_pid() is usable])
+  fi])
+AC_DEFUN([LINUX_EXPORTS_PROC_ROOT_FS], [
+  AC_MSG_CHECKING([if proc_root_fs is defined and exported])
+  AC_CACHE_VAL([ac_cv_linux_exports_proc_root_fs], [
+    AC_TRY_KBUILD(
+[#include <linux/proc_fs.h>],
+[struct proc_dir_entry *p = proc_root_fs;],
+      ac_cv_linux_exports_proc_root_fs=yes,
+      ac_cv_linux_exports_proc_root_fs=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_proc_root_fs)
+  if test "x$ac_cv_linux_exports_proc_root_fs" = "xyes"; then
+    AC_DEFINE([EXPORTED_PROC_ROOT_FS], 1, [define if proc_root_fs is exported])
+  fi])
+AC_DEFUN([LINUX_D_PATH_TAKES_STRUCT_PATH], [
+  AC_MSG_CHECKING([if d_path() takes a struct path argument])
+  AC_CACHE_VAL([ac_cv_linux_d_path_takes_struct_path], [
+    AC_TRY_KBUILD(
+[#include <linux/dcache.h>],
+[struct path *p;
+d_path(p, NULL, 0);],
+      ac_cv_linux_d_path_takes_struct_path=yes,
+      ac_cv_linux_d_path_takes_struct_path=no)])
+  AC_MSG_RESULT($ac_cv_linux_d_path_takes_struct_path)
+  if test "x$ac_cv_linux_d_path_takes_struct_path" = "xyes"; then
+    AC_DEFINE([D_PATH_TAKES_STRUCT_PATH], 1, [define if d_path() takes a struct path argument])
+  fi])
+AC_DEFUN([LINUX_NEW_EXPORT_OPS], [
+  AC_MSG_CHECKING([if kernel uses new export ops])
+  AC_CACHE_VAL([ac_cv_linux_new_export_ops], [
+    AC_TRY_KBUILD(
+[#include <linux/exportfs.h>],
+[struct export_operations _eops;
+_eops.fh_to_parent(NULL, NULL, 0, 0);],
+      ac_cv_linux_new_export_ops=yes,
+      ac_cv_linux_new_export_ops=no)])
+  AC_MSG_RESULT($ac_cv_linux_new_export_ops)
+  if test "x$ac_cv_linux_new_export_ops" = "xyes"; then
+    AC_DEFINE([NEW_EXPORT_OPS], 1, [define if kernel uses new export ops])
+  fi])
+AC_DEFUN([LINUX_SEMAPHORE_H_EXISTS], [
+  AC_MSG_CHECKING([for linux/semaphore.h existance])
+  AC_CACHE_VAL([ac_cv_linux_semaphore_h_exists], [
+    AC_TRY_KBUILD(
+[#include <linux/semaphore.h>],
+[return;],
+      ac_cv_linux_semaphore_h_exists=yes,
+      ac_cv_linux_semaphore_h_exists=no)])
+  AC_MSG_RESULT($ac_cv_linux_semaphore_h_exists)
+  if test "x$ac_cv_linux_semaphore_h_exists" = "xyes"; then
+    AC_DEFINE([LINUX_SEMAPHORE_H], 1, [define if linux/semaphore.h exists])
+  fi])
+
+AC_DEFUN([LINUX_HAVE_BDI_INIT], [
+  AC_MSG_CHECKING([for linux bdi_init()])
+  AC_CACHE_VAL([ac_cv_linux_bdi_init], [
+    AC_TRY_KBUILD(
+[#include <linux/backing-dev.h>],
+[bdi_init(NULL);],
+      ac_cv_linux_bdi_init=yes,
+      ac_cv_linux_bdi_init=no)])
+  AC_MSG_RESULT($ac_cv_linux_bdi_init)
+  if test "x$ac_cv_linux_bdi_init" = "xyes"; then
+    AC_DEFINE([HAVE_BDI_INIT], 1, [define if your kernel has a bdi_init()])
+  fi])
+
+AC_DEFUN([LINUX_HAVE_WRITE_BEGIN_AOP], [
+  AC_MSG_CHECKING([for linux write_begin() address space op])
+  AC_CACHE_VAL([ac_cv_linux_write_begin], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[simple_write_begin(NULL, NULL, 0, 0, 0, NULL, NULL);],
+      ac_cv_linux_write_begin=yes,
+      ac_cv_linux_write_begin=no)])
+  AC_MSG_RESULT($ac_cv_linux_write_begin)
+  if test "x$ac_cv_linux_write_begin" = "xyes"; then
+    AC_DEFINE([HAVE_WRITE_BEGIN], 1, [define if your kernel has a write_begin() address space op])
+  fi])