]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: use standard macro for set_nlink configure test
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 18 Jan 2012 15:25:03 +0000 (10:25 -0500)
committerDerrick Brashear <shadow@dementix.org>
Mon, 23 Jan 2012 15:25:27 +0000 (07:25 -0800)
A generic macro exists to test for functions in the kernel, use
it for set_nlink.

Reviewed-on: http://gerrit.openafs.org/6566
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 64bd0b728ca95ba7bb4f1fdd909386fde3ce81e1)

Change-Id: I93d169bec8f476d5e692f7f5a7fe31002af7ce1e
Reviewed-on: http://gerrit.openafs.org/6569
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
acinclude.m4
src/afs/LINUX/osi_vfsops.c
src/cf/linux-test4.m4

index c7bb588704d0ae0636bdab73636e0bbb0538bf8e..41ef6d1a4c5feba0288e573d8c4b75361dbb754e 100644 (file)
@@ -887,6 +887,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_FUNC([rcu_read_lock],
                                     [#include <linux/rcupdate.h>],
                                     [rcu_read_lock();])
+                AC_CHECK_LINUX_FUNC([set_nlink],
+                                    [#include <linux/fs.h>],
+                                    [set_nlink(NULL, 1);])
                 AC_CHECK_LINUX_FUNC([splice_direct_to_actor],
                                     [#include <linux/splice.h>],
                                     [splice_direct_to_actor(NULL,NULL,NULL);])
@@ -947,7 +950,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
                 LINUX_HAVE_DCACHE_LOCK
                 LINUX_D_COUNT_IS_INT
-                LINUX_HAVE_SET_NLINK
 
                 dnl If we are guaranteed that keyrings will work - that is
                 dnl  a) The kernel has keyrings enabled
index 0d41bc7f3b983fb2f565a37d2077a81e5351896a..faa5715490a9c467f105555d10ec12a8c2aa06e3 100644 (file)
@@ -440,7 +440,7 @@ void
 vattr2inode(struct inode *ip, struct vattr *vp)
 {
     ip->i_ino = vp->va_nodeid;
-#ifdef HAVE_SET_NLINK
+#ifdef HAVE_LINUX_SET_NLINK
     set_nlink(ip, vp->va_nlink);
 #else
     ip->i_nlink = vp->va_nlink;
index 4e053817121b9fbeb47f9a3c788c585aa85be0f7..d99feadf326aeea7abfb779754863df59d952d86 100644 (file)
@@ -634,15 +634,3 @@ AC_DEFUN([LINUX_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])
-])