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>
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);])
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
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;
[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])
-])