From: Mark Vitale Date: Thu, 20 Oct 2016 04:49:37 +0000 (-0400) Subject: Linux 4.9: inode_change_ok() becomes setattr_prepare() X-Git-Tag: upstream/1.8.0_pre1^2~35 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8aeb711eeaa5ddac5a74c354091e2d4f7ac0cd63;p=packages%2Fo%2Fopenafs.git Linux 4.9: inode_change_ok() becomes setattr_prepare() Linux commit 31051c85b5e2 "fs: Give dentry to inode_change_ok() instead of inode" renames and modifies inode_change_ok(inode, attrs) to setattr_prepare(dentry, attrs). Modify OpenAFS to cope. Change-Id: I72f8dfbdbd25d7c775e9c35116e323ea4359e95c Reviewed-on: https://gerrit.openafs.org/12418 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/acinclude.m4 b/acinclude.m4 index f8c8456da..c46a12073 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1082,6 +1082,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) AC_CHECK_LINUX_FUNC([set_nlink], [#include ], [set_nlink(NULL, 1);]) + AC_CHECK_LINUX_FUNC([setattr_prepare], + [#include ], + [setattr_prepare(NULL, NULL);]) AC_CHECK_LINUX_FUNC([sock_create_kern], [#include ], [sock_create_kern(0, 0, 0, NULL);]) diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index c125c1ca7..e211c055f 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -183,7 +183,11 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize) newattrs.ia_ctime = CURRENT_TIME; /* avoid notify_change() since it wants to update dentry->d_parent */ +#ifdef HAVE_LINUX_SETATTR_PREPARE + code = setattr_prepare(file_dentry(afile->filp), &newattrs); +#else code = inode_change_ok(inode, &newattrs); +#endif if (!code) code = afs_inode_setattr(afile, &newattrs); if (!code)