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.
Change-Id: Ie17cf4c645d754c9e9efd8a603f1bc752d07cf36
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>
#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 */
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)