-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kernel timer API rework #8647
Merged
+103
−40
Merged
kernel timer API rework #8647
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,32 +1,73 @@ | ||
dnl # 4.14-rc3 API change | ||
dnl # https://lwn.net/Articles/735887/ | ||
dnl # | ||
dnl # 4.15 API change | ||
dnl # https://lkml.org/lkml/2017/11/25/90 | ||
dnl # Check if timer_list.func get passed a timer_list or an unsigned long | ||
dnl # (older kernels). Also sanity check the from_timer() and timer_setup() | ||
dnl # macros are available as well, since they will be used in the same newer | ||
dnl # kernels that support the new timer_list.func signature. | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_TIMER_FUNCTION_TIMER_LIST], [ | ||
AC_MSG_CHECKING([whether timer_list.function gets a timer_list]) | ||
dnl # Also check for the existance of flags in struct timer_list, they were | ||
dnl # added in 4.1-rc8 via 0eeda71bc30d. | ||
|
||
AC_DEFUN([ZFS_AC_KERNEL_TIMER_SETUP], [ | ||
AC_MSG_CHECKING([whether timer_setup() is available]) | ||
tmp_flags="$EXTRA_KCFLAGS" | ||
EXTRA_KCFLAGS="-Werror" | ||
|
||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/timer.h> | ||
void task_expire(struct timer_list *tl) {} | ||
|
||
struct my_task_timer { | ||
struct timer_list timer; | ||
int data; | ||
}; | ||
|
||
void task_expire(struct timer_list *tl) | ||
{ | ||
struct my_task_timer *task_timer = from_timer(task_timer, tl, timer); | ||
task_timer->data = 42; | ||
} | ||
],[ | ||
struct my_task_timer task_timer; | ||
timer_setup(&task_timer.timer, task_expire, 0); | ||
],[ | ||
#ifndef from_timer | ||
#error "No from_timer() macro" | ||
#endif | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_KERNEL_TIMER_SETUP, 1, | ||
[timer_setup() is available]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
|
||
struct timer_list timer; | ||
timer.function = task_expire; | ||
timer_setup(&timer, NULL, 0); | ||
AC_MSG_CHECKING([whether timer function expects timer_list]) | ||
|
||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/timer.h> | ||
void task_expire(struct timer_list *tl) {} | ||
],[ | ||
struct timer_list tl; | ||
tl.function = task_expire; | ||
],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST, 1, | ||
[timer_list.function gets a timer_list]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
|
||
AC_MSG_CHECKING([whether struct timer_list has flags]) | ||
|
||
ZFS_LINUX_TRY_COMPILE([ | ||
#include <linux/timer.h> | ||
],[ | ||
struct timer_list tl; | ||
tl.flags = 2; | ||
],[ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_KERNEL_TIMER_LIST_FLAGS, 1, | ||
[struct timer_list has a flags member]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
|
||
EXTRA_KCFLAGS="$tmp_flags" | ||
]) |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There 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 change is from a commit in 4.2 kernel.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0eeda71bc30d74f66f8231f45621d5ace3419186