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 <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Requires-spl: refs/pull/581/head
This commit is contained in:
Brian Behlendorf
2016-10-18 23:49:23 +00:00
parent 0fedeedd30
commit 3b0ba3ba99
4 changed files with 36 additions and 1 deletions
+1 -1
View File
@@ -323,7 +323,7 @@ zpl_setattr(struct dentry *dentry, struct iattr *ia)
int error;
fstrans_cookie_t cookie;
error = inode_change_ok(ip, ia);
error = setattr_prepare(dentry, ia);
if (error)
return (error);