diff --git a/acinclude.m4 b/acinclude.m4 index c7bb588704..41ef6d1a4c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -887,6 +887,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_FUNC([rcu_read_lock], [#include ], [rcu_read_lock();]) + AC_CHECK_LINUX_FUNC([set_nlink], + [#include ], + [set_nlink(NULL, 1);]) AC_CHECK_LINUX_FUNC([splice_direct_to_actor], [#include ], [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 diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 0d41bc7f3b..faa5715490 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -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; diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 4e05381712..d99feadf32 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -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 ], - [struct inode _inode; - set_nlink(&_inode, 1);], - [HAVE_SET_NLINK], - [define if set_nlink exists], - [-Werror]) -])