]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux 4.9: inode_change_ok() becomes setattr_prepare()
authorMark Vitale <mvitale@sinenomine.net>
Thu, 20 Oct 2016 04:49:37 +0000 (00:49 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 14 Dec 2016 17:25:31 +0000 (12:25 -0500)
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.

Reviewed-on: https://gerrit.openafs.org/12418
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8aeb711eeaa5ddac5a74c354091e2d4f7ac0cd63)

Change-Id: I7f08c57b7f61465a1ea18333306f52f77bd65084
Reviewed-on: https://gerrit.openafs.org/12480
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
acinclude.m4
src/afs/LINUX/osi_file.c

index 9790a975ec73a149c88103befa590a854c409d78..bcf8ecf48f31333f152f2fe95e4ff2a45a3690a7 100644 (file)
@@ -1028,6 +1028,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_FUNC([set_nlink],
                                     [#include <linux/fs.h>],
                                     [set_nlink(NULL, 1);])
+                AC_CHECK_LINUX_FUNC([setattr_prepare],
+                                    [#include <linux/fs.h>],
+                                    [setattr_prepare(NULL, NULL);])
                 AC_CHECK_LINUX_FUNC([sock_create_kern],
                                     [#include <linux/net.h>],
                                     [sock_create_kern(0, 0, 0, NULL);])
index ea0ea5d233860170904e8f5436a64492bb472cf1..b230c0bf5db770feb3e1435d6ebcd0e25d907365 100644 (file)
@@ -184,7 +184,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)