summarylogtreecommitdiffstats
path: root/0010-Linux-Create-wrapper-for-setattr_prepare.patch
diff options
context:
space:
mode:
authorMichael Laß2021-05-02 14:05:46 +0200
committerMichael Laß2021-05-02 14:05:46 +0200
commit2fa0fed49d93dc74dafb451979b3cc90bfb9500d (patch)
treee197de41fad408e0d9864dd9cb28de0578f5cf4b /0010-Linux-Create-wrapper-for-setattr_prepare.patch
parent568944fe97884e823e50b6a34ed6580dbe45a377 (diff)
downloadaur-2fa0fed49d93dc74dafb451979b3cc90bfb9500d.tar.gz
Prepare for Linux 5.12
Diffstat (limited to '0010-Linux-Create-wrapper-for-setattr_prepare.patch')
-rw-r--r--0010-Linux-Create-wrapper-for-setattr_prepare.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/0010-Linux-Create-wrapper-for-setattr_prepare.patch b/0010-Linux-Create-wrapper-for-setattr_prepare.patch
new file mode 100644
index 000000000000..fe75325bc8a9
--- /dev/null
+++ b/0010-Linux-Create-wrapper-for-setattr_prepare.patch
@@ -0,0 +1,65 @@
+From 06c067eb25fafd8d18de204a3df430e114fc8871 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Mon, 8 Mar 2021 09:22:04 -0700
+Subject: [PATCH 10/11] Linux: Create wrapper for setattr_prepare
+
+Move call to setattr_prepare/inode_change_ok into an osi_compat.h
+wrapper called 'afs_setattr_prepare'. This moves some of the #if logic
+out of the mainline code.
+
+Reviewed-on: https://gerrit.openafs.org/14548
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 12ae2beeeb172cebdfa24d5ea149f73fd85541f8)
+
+Change-Id: I1c7806893daf2404a8b3ac1b5c88ca04e6409226
+Reviewed-on: https://gerrit.openafs.org/14564
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+ src/afs/LINUX/osi_compat.h | 10 ++++++++++
+ src/afs/LINUX/osi_file.c | 6 +-----
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index a1e7f21fb..3ac4d798d 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -748,4 +748,14 @@ afs_d_path(struct dentry *dp, struct vfsmount *mnt, char *buf, int buflen)
+ #endif
+ }
+
++static inline int
++afs_setattr_prepare(struct dentry *dp, struct iattr *newattrs)
++{
++#if defined(HAVE_LINUX_SETATTR_PREPARE)
++ return setattr_prepare(dp, newattrs);
++#else
++ return inode_change_ok(dp->d_inode, newattrs);
++#endif
++}
++
+ #endif /* AFS_LINUX_OSI_COMPAT_H */
+diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c
+index 5b0a0c01d..982cf47e7 100644
+--- a/src/afs/LINUX/osi_file.c
++++ b/src/afs/LINUX/osi_file.c
+@@ -205,11 +205,7 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
+ AFS_CURRENT_TIME(&newattrs.ia_ctime);
+
+ /* 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
++ code = afs_setattr_prepare(file_dentry(afile->filp), &newattrs);
+ if (!code)
+ code = afs_inode_setattr(afile, &newattrs);
+ if (!code)
+--
+2.31.1
+