forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux 3.5 compatibility: miscellaneous changes
torvalds/linux@b0b0382 changed export_operations->encode_fn() to use struct inode * instead of struct dentry * torvalds/linux@dbd5768 renamed end_writeback() to clear_inode() torvalds/linux@17cf28a removed inode_operations->truncate_range(). The file hole punching functionality is provided by inode_operations->fallocate() Closes openzfs#784 Signed-off-by: Richard Yao <[email protected]>
- Loading branch information
Showing
7 changed files
with
80 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,13 @@ | ||
dnl # | ||
dnl # 3.5.0 API change | ||
dnl # torvalds/linux@90324cc1b11a211e37eabd8cb863e1a1561d6b1d renamed | ||
dnl # end_writeback() to clear_inode(). | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_CLEAR_INODE], [ | ||
ZFS_CHECK_SYMBOL_EXPORT( | ||
[clear_inode], | ||
[fs/inode.c], | ||
[AC_DEFINE(HAVE_CLEAR_INODE, 1, | ||
[clear_inode() is available])], | ||
[]) | ||
]) |
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 # 3.5.0 API change # | ||
dnl # torvalds/linux@b0b0382bb4904965a9e9fca77ad87514dfda0d1c changed the header | ||
dnl # to use struct inode * instead of struct dentry * | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_EXPORT_ENCODE_FH_WITH_INODE_PARAMETER], [ | ||
AC_MSG_CHECKING([export_operations->encodefh()]) | ||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/exportfs.h> | ||
],[ | ||
int (*encode_fh)(struct inode *, __u32 *fh, int *, struct inode *) = NULL; | ||
struct export_operations export_ops = { | ||
.encode_fh = encode_fh, | ||
}; | ||
export_ops.encode_fh(0, 0, 0, 0); | ||
],[ | ||
AC_MSG_RESULT(uses struct inode * as first parameter) | ||
AC_DEFINE(HAVE_EXPORT_ENCODE_FH_WITH_INODE_PARAMETER, 1, | ||
[fhfn() uses struct inode *]) | ||
],[ | ||
AC_MSG_RESULT(does not use struct inode * as first parameter) | ||
]) | ||
]) |
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,26 @@ | ||
dnl # | ||
dnl # 3.5.0 API change # | ||
dnl # torvalds/linux@17cf28afea2a1112f240a3a2da8af883be024811 removed | ||
dnl # truncate_range(). The file hole punching functionality is provided by | ||
dnl # fallocate() | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_INODE_TRUNCATE_RANGE], [ | ||
AC_MSG_CHECKING([inode_operations->truncate_range() exists]) | ||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/fs.h> | ||
],[ | ||
void (*tr)(struct inode *, loff_t, loff_t) = NULL; | ||
struct inode_operations inode_ops = { | ||
.truncate_range = tr, | ||
}; | ||
inode_ops.truncate_range(0, 0, 0); | ||
],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_INODE_TRUNCATE_RANGE, 1, | ||
[inode_operations->truncate_range() exists]) | ||
],[ | ||
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
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