aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/vfs_compat.h
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2016-10-18 23:49:23 +0000
committerBrian Behlendorf <[email protected]>2016-10-20 09:39:09 -0700
commit3b0ba3ba99b8a3af0fb532bf264629436b1abd84 (patch)
tree962afba9779cd11c14a3b89b1586af74af9b6cbc /include/linux/vfs_compat.h
parent0fedeedd309eca62d15fffd8bd811e2b12660e21 (diff)
Linux 4.9 compat: inode_change_ok() renamed setattr_prepare()
In torvalds/linux@31051c8 the inode_change_ok() function was renamed setattr_prepare() and updated to take a dentry ratheri than an inode. Update the code to call the setattr_prepare() and add a wrapper function which call inode_change_ok() for older kernels. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Requires-spl: refs/pull/581/head
Diffstat (limited to 'include/linux/vfs_compat.h')
-rw-r--r--include/linux/vfs_compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h
index 8a64cabef..989c237a3 100644
--- a/include/linux/vfs_compat.h
+++ b/include/linux/vfs_compat.h
@@ -444,4 +444,15 @@ static inline void zfs_gid_write(struct inode *ip, gid_t gid)
#define zpl_follow_up(path) follow_up(path)
#endif
+/*
+ * 4.9 API change
+ */
+#ifndef HAVE_SETATTR_PREPARE
+static inline int
+setattr_prepare(struct dentry *dentry, struct iattr *ia)
+{
+ return (inode_change_ok(dentry->d_inode, ia));
+}
+#endif
+
#endif /* _ZFS_VFS_H */