Linux: 3.2: Use set_nlink to update i_nlink
[openafs.git] / src / cf / linux-test4.m4
index 8b4fd94..894136f 100644 (file)
@@ -7,7 +7,8 @@ extern rwlock_t tasklist_lock __attribute__((weak));
 read_lock(&tasklist_lock);
 ],
                       [EXPORTED_TASKLIST_LOCK],
-                      [define if tasklist_lock exported])
+                      [define if tasklist_lock exported],
+                      [])
 ])
 
 AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [
@@ -20,7 +21,8 @@ AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [
 lose
 #endif],
                       [HAVE_LINUX_COMPLETION_H]
-                      [Define if your kernel has a usable linux/completion.h])
+                      [Define if your kernel has a usable linux/completion.h],
+                      [])
 ])
 
 
@@ -30,7 +32,8 @@ AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
                       [extern struct mm_struct init_mm;],
                       [void *address = &init_mm; printk("%p\n", address);],
                       [EXPORTED_INIT_MM],
-                      [define if your kernel exports init_mm])
+                      [define if your kernel exports init_mm],
+                      [])
   ])
 
 
@@ -42,7 +45,8 @@ AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
 #error kallsyms_address_to_symbol not exported
 #endif],
                       [EXPORTED_KALLSYMS_ADDRESS],
-                      [define if your linux kernel exports kallsyms address])
+                      [define if your linux kernel exports kallsyms address],
+                      [])
 ])
 
 
@@ -54,7 +58,8 @@ AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
 #error kallsyms_symbol_to_address not exported
 #endif],
                       [EXPORTED_KALLSYMS_SYMBOL],
-                      [define if your linux kernel exports kallsyms])
+                      [define if your linux kernel exports kallsyms],
+                      [])
 ])
 
 
@@ -66,7 +71,8 @@ AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
 #error sys_call_table not exported
 #endif],
                       [EXPORTED_SYS_CALL_TABLE],
-                      [define if your linux kernel exports sys_call_table])
+                      [define if your linux kernel exports sys_call_table],
+                      [])
 ])
 
 
@@ -78,7 +84,8 @@ AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
 #error ia32_sys_call_table not exported
 #endif],
                       [EXPORTED_IA32_SYS_CALL_TABLE],
-                      [define if your linux kernel exports ia32_sys_call_table])
+                      [define if your linux kernel exports ia32_sys_call_table],
+                      [])
 ])
 
 
@@ -88,7 +95,8 @@ AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
                       [extern asmlinkage long sys_chdir(void) __attribute__((weak));],
                       [void *address = &sys_chdir; printk("%p\n", address);],
                       [EXPORTED_SYS_CHDIR],
-                      [define if your linux kernel exports sys_chdir])
+                      [define if your linux kernel exports sys_chdir],
+                      [])
 ])
 
 
@@ -98,7 +106,8 @@ AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
                       [extern asmlinkage long sys_open(void) __attribute__((weak));],
                       [void *address = &sys_open; printk("%p\n", address);],
                       [EXPORTED_SYS_OPEN],
-                      [define if your linux kernel exports sys_open])
+                      [define if your linux kernel exports sys_open],
+                      [])
 ])
 
 
@@ -108,7 +117,8 @@ AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
                       [#include <linux/sched.h>],
                       [recalc_sigpending();],
                       [RECALC_SIGPENDING_TAKES_VOID],
-                      [define if your recalc_sigpending takes void])
+                      [define if your recalc_sigpending takes void],
+                      [])
 ])
 
 
@@ -118,7 +128,8 @@ AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
                       [#include <linux/sched.h>],
                       [struct task_struct _tsk; printk("%d\n", _tsk.signal->rlim);],
                       [STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM],
-                      [define if your struct task_struct has signal->rlim])
+                      [define if your struct task_struct has signal->rlim],
+                      [])
 ])
 
 
@@ -128,7 +139,8 @@ AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
                       [#include <linux/fs.h>],
                       [posix_lock_file(0,0,0);],
                       [POSIX_LOCK_FILE_WAIT_ARG],
-                      [define if your kernel uses 3 arguments for posix_lock_file])
+                      [define if your kernel uses 3 arguments for posix_lock_file],
+                      [])
 ])
 
 AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
@@ -137,7 +149,8 @@ AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
                       [#include <linux/net.h>],
                       [sock_create(0,0,0,0,0);],
                       [LINUX_KERNEL_SOCK_CREATE_V],
-                      [define if your linux kernel uses 5 arguments for sock_create])
+                      [define if your linux kernel uses 5 arguments for sock_create],
+                      [])
 ])
 
 
@@ -150,7 +163,8 @@ AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
                        int i;
                        i = inode_setattr(&_inode, &_iattr);],
                       [INODE_SETATTR_NOT_VOID],
-                      [define if your setattr return return non-void])
+                      [define if your setattr return return non-void],
+                      [])
 ])
 
 
@@ -166,7 +180,8 @@ struct page _page;
 struct writeback_control _writeback_control;
 (void)_aops.writepage(&_page, &_writeback_control);],
                       [AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL],
-                      [define if aops.writepage takes a struct writeback_control])
+                      [define if aops.writepage takes a struct writeback_control],
+                      [])
 ])
 
 
@@ -179,7 +194,8 @@ AC_DEFUN([LINUX_REFRIGERATOR], [
 #endif],
                       [refrigerator(PF_FREEZE);],
                       [LINUX_REFRIGERATOR_TAKES_PF_FREEZE],
-                      [define if your refrigerator takes PF_FREEZE])
+                      [define if your refrigerator takes PF_FREEZE],
+                      [])
 ])
 
 
@@ -194,7 +210,8 @@ struct nameidata _nameidata;
 (void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
 
                       [IOP_CREATE_TAKES_NAMEIDATA],
-                      [define if your iops.create takes a nameidata argument])
+                      [define if your iops.create takes a nameidata argument],
+                      [])
 ])
 
 
@@ -208,7 +225,8 @@ struct dentry _dentry;
 struct nameidata _nameidata;
 (void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
                       [IOP_LOOKUP_TAKES_NAMEIDATA],
-                      [define if your iops.lookup takes a nameidata argument])
+                      [define if your iops.lookup takes a nameidata argument],
+                      [])
 ])
 
 
@@ -218,11 +236,24 @@ AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
 [#include <linux/fs.h>
 #include <linux/namei.h>],
 [struct inode _inode;
-struct dentry _dentry;
 struct nameidata _nameidata;
 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
                       [IOP_PERMISSION_TAKES_NAMEIDATA],
-                      [define if your iops.permission takes a nameidata argument])
+                      [define if your iops.permission takes a nameidata argument],
+                      [-Werror])
+])
+
+
+AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_FLAGS], [
+  AC_CHECK_LINUX_BUILD([whether inode_operations.permission takes flags],
+                       [ac_cv_linux_func_i_permission_takes_flags],
+                       [#include <linux/fs.h>],
+                       [struct inode _inode = {0};
+                       unsigned int flags = 0;
+                       (void)_inode.i_op->permission(&_inode, 0, flags);],
+                      [IOP_PERMISSION_TAKES_FLAGS],
+                      [define if your iops.permission takes a flags argument],
+                      [-Werror])
 ])
 
 
@@ -237,7 +268,8 @@ struct nameidata _nameidata;
 void *cookie;
 (void)_inode.i_op->put_link(&_dentry, &_nameidata, cookie);],
                       [IOP_PUT_LINK_TAKES_COOKIE],
-                      [define if your iops.put_link takes a cookie])
+                      [define if your iops.put_link takes a cookie],
+                      [])
 ])
 
 
@@ -250,7 +282,8 @@ AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
 struct nameidata _nameidata;
 (void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
                       [DOP_REVALIDATE_TAKES_NAMEIDATA],
-                      [define if your dops.d_revalidate takes a nameidata argument])
+                      [define if your dops.d_revalidate takes a nameidata argument],
+                      [])
 ])
 
 
@@ -260,7 +293,8 @@ AC_DEFUN([LINUX_GET_SB_HAS_STRUCT_VFSMOUNT], [
                       [#include <linux/fs.h>],
                       [get_sb_nodev(0,0,0,0,0);],
                       [GET_SB_HAS_STRUCT_VFSMOUNT],
-                      [define if your get_sb_nodev needs a struct vfsmount argument])
+                      [define if your get_sb_nodev needs a struct vfsmount argument],
+                      [])
 ])
 
 
@@ -269,9 +303,10 @@ AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
                       [ac_cv_linux_statfs_takes_dentry],
 [#include <linux/fs.h>
 #include <linux/statfs.h>],
-                      [extern int vfs_statfs(struct dentry *, struct kstatfs *);],
+[extern int simple_statfs(struct dentry *, struct kstatfs *);],
                       [STATFS_TAKES_DENTRY],
-                      [define if your statfs takes a dentry argument])
+                      [define if your statfs takes a dentry argument],
+                      [])
 ])
 
 
@@ -293,48 +328,34 @@ request_key(NULL, NULL, NULL);
 #error rebuild your kernel with CONFIG_KEYS
 #endif],
                       [LINUX_KEYRING_SUPPORT],
-                      [define if your kernel has keyring support])
+                      [define if your kernel has keyring support],
+                      [])
 ])
 
 
 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK], [
-  AC_CACHE_CHECK([if key_alloc() takes a struct task *],
-                [ac_cv_key_alloc_needs_struct_task],
-[
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
-    AC_TRY_KBUILD(
-[#include <linux/rwsem.h>
-#include <linux/key.h>
-],
-[struct task_struct *t=NULL;
-(void) key_alloc(NULL, NULL, 0, 0, t, 0, 0);],
-      ac_cv_key_alloc_needs_struct_task=yes,
-      ac_cv_key_alloc_needs_struct_task=no)
-    CPPFLAGS="$save_CPPFLAGS"])
-  AS_IF([test "x$ac_cv_key_alloc_needs_struct_task" = "xyes"],
-       [AC_DEFINE([KEY_ALLOC_NEEDS_STRUCT_TASK], 1,
-                  [define if key_alloc takes a struct task *])])
+  AC_CHECK_LINUX_BUILD([if key_alloc() takes a struct task *],
+                       [ac_cv_key_alloc_needs_struct_task],
+                       [#include <linux/rwsem.h>
+                       #include <linux/key.h> ],
+                       [struct task_struct *t=NULL;
+                       (void) key_alloc(NULL, NULL, 0, 0, t, 0, 0);],
+                       [KEY_ALLOC_NEEDS_STRUCT_TASK],
+                       [define if key_alloc takes a struct task *],
+                       [-Werror -Wno-pointer-arith])
 ])
 
 
 AC_DEFUN([LINUX_KEY_ALLOC_NEEDS_CRED], [
-  AC_CACHE_CHECK([if key_alloc() takes credentials],
-                 [ac_cv_key_alloc_needs_cred],
-[
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS -Werror -Wno-pointer-arith"
-    AC_TRY_KBUILD(
-[#include <linux/rwsem.h>
-#include <linux/key.h>],
-[struct cred *c = NULL;
-(void) key_alloc(NULL, NULL, 0, 0, c, 0, 0);],
-      ac_cv_key_alloc_needs_cred=yes,
-      ac_cv_key_alloc_needs_cred=no)
-    CPPFLAGS="$save_CPPFLAGS"])
-  AS_IF([test "x$ac_cv_key_alloc_needs_cred" = "xyes"],
-       [AC_DEFINE([KEY_ALLOC_NEEDS_CRED], 1,
-                  [define if key_alloc takes credentials])])
+  AC_CHECK_LINUX_BUILD([if key_alloc() takes credentials],
+                       [ac_cv_key_alloc_needs_cred],
+                       [#include <linux/rwsem.h>
+                       #include <linux/key.h>],
+                       [struct cred *c = NULL;
+                       (void) key_alloc(NULL, NULL, 0, 0, c, 0, 0);],
+                       [KEY_ALLOC_NEEDS_CRED],
+                       [define if key_alloc takes credentials],
+                       [-Werror -Wno-pointer-arith])
 ])
 
 
@@ -349,7 +370,8 @@ struct work_struct *w;
 int *i;
 INIT_WORK(w,f,i);],
                       [INIT_WORK_HAS_DATA],
-                      [define if INIT_WORK takes a data (3rd) argument])
+                      [define if INIT_WORK takes a data (3rd) argument],
+                      [])
 ])
 
 
@@ -359,7 +381,8 @@ AC_DEFUN([LINUX_REGISTER_SYSCTL_TABLE_NOFLAG], [
                       [#include <linux/sysctl.h>],
                       [ctl_table *t; register_sysctl_table (t);],
                       [REGISTER_SYSCTL_TABLE_NOFLAG],
-                      [define if register_sysctl_table has no insert_at head flag])
+                      [define if register_sysctl_table has no insert_at head flag],
+                      [])
 ])
 
 
@@ -372,7 +395,38 @@ struct file _file;
 fl_owner_t id;
 (void)_inode.i_fop->flush(&_file, &id);],
                       [FOP_FLUSH_TAKES_FL_OWNER_T],
-                      [define if your fops.flush takes an fl_owner_t argument])
+                      [define if your fops.flush takes an fl_owner_t argument],
+                      [])
+])
+
+
+AC_DEFUN([LINUX_FOP_F_FSYNC_TAKES_DENTRY], [
+  AC_CHECK_LINUX_BUILD([whether file_operations.fsync takes a dentry argument],
+                      [ac_cv_linux_func_f_fsync_takes_dentry],
+                      [#include <linux/fs.h>],
+[struct inode _inode;
+struct file _file;
+struct dentry _d;
+(void)_inode.i_fop->fsync(&_file, &_d, 0);],
+                      [FOP_FSYNC_TAKES_DENTRY],
+                      [define if your fops.fsync takes an dentry argument],
+                      [])
+])
+
+
+int (*fsync) (struct file *, loff_t start, loff_t end, int datasync);
+
+AC_DEFUN([LINUX_FOP_F_FSYNC_TAKES_RANGE], [
+  AC_CHECK_LINUX_BUILD([whether file_operations.fsync takes a range],
+                      [ac_cv_linux_func_f_fsync_takes_range],
+                      [#include <linux/fs.h>],
+[struct inode _inode;
+struct file _file;
+loff_t start, end;
+(void)_inode.i_fop->fsync(&_file, start, end, 0);],
+                      [FOP_FSYNC_TAKES_RANGE],
+                      [define if your fops.fsync takes range arguments],
+                      [])
 ])
 
 
@@ -382,7 +436,8 @@ AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
                       [#include <linux/slab.h>],
                       [kmem_cache_t *k;],
                       [HAVE_KMEM_CACHE_T],
-                      [define if kmem_cache_t exists])
+                      [define if kmem_cache_t exists],
+                      [])
 ])
 
 
@@ -392,24 +447,19 @@ AC_DEFUN([LINUX_KMEM_CACHE_CREATE_TAKES_DTOR], [
                       [#include <linux/slab.h>],
                       [kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);],
                       [KMEM_CACHE_TAKES_DTOR],
-                      [define if kmem_cache_create takes a destructor argument])
+                      [define if kmem_cache_create takes a destructor argument],
+                      [])
 ])
 
 
 AC_DEFUN([LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID],[
-  AC_CACHE_CHECK([whether kmem_cache_create constructor takes a void pointer],
-                [ac_cv_linux_kmem_cache_create_ctor_takes_void], [
-    save_CPPFLAGS="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS -Werror"
-    AC_TRY_KBUILD([#include <linux/slab.h>],
-                 [void _ctor(void *v) { }; kmem_cache_create(NULL, 0, 0, 0, _ctor);],
-                 ac_cv_linux_kmem_cache_create_ctor_takes_void=yes,
-                 ac_cv_linux_kmem_cache_create_ctor_takes_void=no)
-    CPPFLAGS="$save_CPPFLAGS"
-  ])
-  AS_IF([test "x$ac_cv_linux_kmem_cache_create_ctor_takes_void" = "xyes"],
-        [AC_DEFINE([KMEM_CACHE_CTOR_TAKES_VOID], 1,
-                  [define if kmem_cache_create constructor takes a single void ptr])])
+  AC_CHECK_LINUX_BUILD([whether kmem_cache_create constructor takes a void pointer],
+                       [ac_cv_linux_kmem_cache_create_ctor_takes_void],
+                       [#include <linux/slab.h>],
+                       [void _ctor(void *v) { }; kmem_cache_create(NULL, 0, 0, 0, _ctor);],
+                       [KMEM_CACHE_CTOR_TAKES_VOID],
+                       [define if kmem_cache_create constructor takes a single void ptr],
+                       [-Werror])
 ])
 
 
@@ -424,7 +474,8 @@ AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SPLICE], [
                        _fop.splice_write(NULL, NULL, NULL, 0, 0);
                        _fop.splice_read(NULL, NULL, NULL, 0, 0);],
                       [STRUCT_FILE_OPERATIONS_HAS_SPLICE],
-                      [define if struct file_operations has splice functions])
+                      [define if struct file_operations has splice functions],
+                      [])
 ])
 
 
@@ -438,18 +489,8 @@ AC_DEFUN([LINUX_KMEM_CACHE_INIT], [
                                          void (*)(struct kmem_cache *, void *));
                        return;],
                       [KMEM_CACHE_INIT],
-                      [define for new kmem_cache init function parameters])
-])
-
-
-AC_DEFUN([LINUX_SYSCTL_TABLE_CHECKING], [
-  AC_CHECK_LINUX_BUILD([for sysctl table checking],
-                      [ac_cv_linux_sysctl_table_checking],
-                      [#include <linux/sysctl.h>],
-                      [extern int sysctl_check_table(int) __attribute__((weak));
-                       sysctl_check_table(NULL);],
-                      [SYSCTL_TABLE_CHECKING],
-                      [define if your kernel has sysctl table checking])
+                      [define for new kmem_cache init function parameters],
+                      [])
 ])
 
 
@@ -459,17 +500,19 @@ AC_DEFUN([LINUX_EXPORTS_PROC_ROOT_FS], [
                       [#include <linux/proc_fs.h>],
                       [struct proc_dir_entry *p = proc_root_fs;],
                       [EXPORTED_PROC_ROOT_FS],
-                      [define if proc_root_fs is exported])
+                      [define if proc_root_fs is exported],
+                      [])
 ])
 
 
 AC_DEFUN([LINUX_D_PATH_TAKES_STRUCT_PATH], [
   AC_CHECK_LINUX_BUILD([if d_path() takes a struct path argument],
                       [ac_cv_linux_d_path_takes_struct_path],
-                      [#include <linux/dcache.h>],
+                      [#include <linux/fs.h>],
                       [struct path *p; d_path(p, NULL, 0);],
                       [D_PATH_TAKES_STRUCT_PATH],
-                      [define if d_path() takes a struct path argument])
+                      [define if d_path() takes a struct path argument],
+                      [])
 ])
 
 
@@ -480,7 +523,8 @@ AC_DEFUN([LINUX_NEW_EXPORT_OPS], [
                       [struct export_operations _eops;
                        _eops.fh_to_parent(NULL, NULL, 0, 0);],
                       [NEW_EXPORT_OPS],
-                      [define if kernel uses new export ops])
+                      [define if kernel uses new export ops],
+                      [])
 ])
 
 
@@ -492,7 +536,8 @@ AC_DEFUN([LINUX_POSIX_TEST_LOCK_RETURNS_CONFLICT], [
                        struct file * file;
                        lock = posix_test_lock(file, lock);],
                       [POSIX_TEST_LOCK_RETURNS_CONFLICT],
-                      [define if posix_test_lock returns the conflicting lock])
+                      [define if posix_test_lock returns the conflicting lock],
+                      [])
 ])
 
 
@@ -504,7 +549,8 @@ AC_DEFUN([LINUX_POSIX_TEST_LOCK_CONFLICT_ARG], [
                        struct file *file;
                        posix_test_lock(file, lock, lock);],
                       [POSIX_TEST_LOCK_CONFLICT_ARG],
-                      [define if posix_test_lock takes a conflict argument])
+                      [define if posix_test_lock takes a conflict argument],
+                      [])
 ])
 
 
@@ -519,17 +565,8 @@ AC_DEFUN([LINUX_EXPORTS_KEY_TYPE_KEYRING], [
 ],
                       [printk("%s", key_type_keyring.name);],
                       [EXPORTED_KEY_TYPE_KEYRING],
-                      [define if key_type_keyring is exported])
-])
-
-
-AC_DEFUN([LINUX_KEYS_HAVE_SESSION_TO_PARENT], [
-  AC_CHECK_LINUX_BUILD([for KEYCTL_SESSION_TO_PARENT],
-                      [ac_cv_linux_have_session_to_parent],
-                      [#include <linux/keyctl.h>],
-                      [int i = KEYCTL_SESSION_TO_PARENT;],
-                      [HAVE_SESSION_TO_PARENT],
-                      [define if keyctl has the KEYCTL_SESSION_TO_PARENT function])
+                      [define if key_type_keyring is exported],
+                      [])
 ])
 
 
@@ -546,6 +583,56 @@ AC_DEFUN([LINUX_HAVE_TRY_TO_FREEZE], [
    try_to_freeze();
 #endif],
                       [HAVE_TRY_TO_FREEZE],
-                       [define if your kernel has the try_to_freeze function])
+                       [define if your kernel has the try_to_freeze function],
+                       [])
 ])
 
+
+AC_DEFUN([LINUX_HAVE_DCACHE_LOCK], [
+  AC_CHECK_LINUX_BUILD([for dcache_lock],
+                       [ac_cv_linux_have_dcache_lock],
+                       [#include <linux/fs.h> ],
+                       [printk("%p", &dcache_lock);],
+                       [HAVE_DCACHE_LOCK],
+                       [define if dcache_lock exists],
+                       [])
+])
+
+
+AC_DEFUN([LINUX_D_COUNT_IS_INT], [
+  AC_CHECK_LINUX_BUILD([if dentry->d_count is an int],
+                       [ac_cv_linux_d_count_int],
+                       [#include <linux/fs.h> ],
+                       [struct dentry _d;
+                       dget(&_d);
+                       _d.d_count = 1;],
+                       [D_COUNT_INT],
+                       [define if dentry->d_count is an int],
+                       [-Werror])
+])
+
+
+AC_DEFUN([LINUX_DOP_D_DELETE_TAKES_CONST], [
+  AC_CHECK_LINUX_BUILD([whether dentry.d_op->d_delete takes a const argument],
+                       [ac_cv_linux_dop_d_delete_takes_const],
+                       [#include <linux/fs.h>
+                       #include <linux/dcache.h>],
+                       [struct dentry_operations _d_ops;
+                       int _d_del(const struct dentry *de) {return 0;};
+                       _d_ops.d_delete = _d_del;],
+                       [DOP_D_DELETE_TAKES_CONST],
+                       [define if dentry.d_op->d_delete takes a const argument],
+                       [-Werror])
+])
+
+
+AC_DEFUN([LINUX_HAVE_SET_NLINK], [
+  AC_CHECK_LINUX_BUILD([for set_nlink],
+                       [ac_cv_linux_have_set_nlink],
+                       [#include <linux/fs.h>],
+                       [struct inode _inode;
+                       set_nlink(&_inode, 1);],
+                       [HAVE_SET_NLINK],
+                       [define if set_nlink exists],
+                       [-Werror])
+])