mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
Linux: 3.2: Use set_nlink to update i_nlink
As of v3.2-rc1~84^2~1, struct inode.i_nlink is now const to prevent direct modification. Change-Id: If0a38ffb7f9964e23f5e64c900ae92f56fb77def Signed-off-by: Anders Kaseorg <andersk@mit.edu> Reviewed-on: http://gerrit.openafs.org/6096 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
e14dec55e6
commit
f1dd2d696f
@ -944,6 +944,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
|
|||||||
LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
|
LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
|
||||||
LINUX_HAVE_DCACHE_LOCK
|
LINUX_HAVE_DCACHE_LOCK
|
||||||
LINUX_D_COUNT_IS_INT
|
LINUX_D_COUNT_IS_INT
|
||||||
|
LINUX_HAVE_SET_NLINK
|
||||||
|
|
||||||
dnl If we are guaranteed that keyrings will work - that is
|
dnl If we are guaranteed that keyrings will work - that is
|
||||||
dnl a) The kernel has keyrings enabled
|
dnl a) The kernel has keyrings enabled
|
||||||
|
@ -439,7 +439,11 @@ void
|
|||||||
vattr2inode(struct inode *ip, struct vattr *vp)
|
vattr2inode(struct inode *ip, struct vattr *vp)
|
||||||
{
|
{
|
||||||
ip->i_ino = vp->va_nodeid;
|
ip->i_ino = vp->va_nodeid;
|
||||||
|
#ifdef HAVE_SET_NLINK
|
||||||
|
set_nlink(ip, vp->va_nlink);
|
||||||
|
#else
|
||||||
ip->i_nlink = vp->va_nlink;
|
ip->i_nlink = vp->va_nlink;
|
||||||
|
#endif
|
||||||
ip->i_blocks = vp->va_blocks;
|
ip->i_blocks = vp->va_blocks;
|
||||||
#ifdef STRUCT_INODE_HAS_I_BLKBITS
|
#ifdef STRUCT_INODE_HAS_I_BLKBITS
|
||||||
ip->i_blkbits = AFS_BLKBITS;
|
ip->i_blkbits = AFS_BLKBITS;
|
||||||
|
@ -624,3 +624,15 @@ AC_DEFUN([LINUX_DOP_D_DELETE_TAKES_CONST], [
|
|||||||
[define if dentry.d_op->d_delete takes a const argument],
|
[define if dentry.d_op->d_delete takes a const argument],
|
||||||
[-Werror])
|
[-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])
|
||||||
|
])
|
||||||
|
Loading…
Reference in New Issue
Block a user