Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
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
- Loading branch information
1 parent
0fedeed
commit 3b0ba3b
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| dnl # | ||
| dnl # 4.9 API change | ||
| dnl # The inode_change_ok() function has been renamed setattr_prepare() | ||
| dnl # and updated to take a dentry rather than an inode. | ||
| dnl # | ||
| AC_DEFUN([ZFS_AC_KERNEL_SETATTR_PREPARE], | ||
| [AC_MSG_CHECKING([whether setattr_prepare() is available]) | ||
| ZFS_LINUX_TRY_COMPILE_SYMBOL([ | ||
| #include <linux/fs.h> | ||
| ], [ | ||
| struct dentry *dentry = NULL; | ||
| struct iattr *attr = NULL; | ||
| int error; | ||
| error = setattr_prepare(dentry, attr); | ||
| ], [setattr_prepare], [fs/attr.c], [ | ||
| AC_MSG_RESULT(yes) | ||
| AC_DEFINE(HAVE_SETATTR_PREPARE, 1, | ||
| [setattr_prepare() is available]) | ||
| ], [ | ||
| AC_MSG_RESULT(no) | ||
| ]) | ||
| ]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3b0ba3bThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got backported now to v3.16.39 ...