1 jbd2: convert timers to use timer_setup()
3 From: Kees Cook <keescook@chromium.org>
5 In preparation for unconditionally passing the struct timer_list pointer to
6 all timer callbacks, switch to using the new timer_setup() and from_timer()
7 to pass the timer pointer explicitly.
9 Signed-off-by: Kees Cook <keescook@chromium.org>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 Reviewed-by: Jan Kara <jack@suse.com>
12 Cc: linux-ext4@vger.kernel.org
13 Cc: Thomas Gleixner <tglx@linutronix.de>
15 This requires commit 686fef928bba ("timer: Prepare to change timer
16 callback argument type") in v4.14-rc3, but should be otherwise
19 fs/jbd2/journal.c | 9 ++++-----
20 1 file changed, 4 insertions(+), 5 deletions(-)
22 diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
23 index 7d5ef3bf3f3e..d2a85c9720e9 100644
24 --- a/fs/jbd2/journal.c
25 +++ b/fs/jbd2/journal.c
26 @@ -165,11 +165,11 @@ static void jbd2_superblock_csum_set(journal_t *j, journal_superblock_t *sb)
27 * Helper function used to manage commit timeouts
30 -static void commit_timeout(unsigned long __data)
31 +static void commit_timeout(struct timer_list *t)
33 - struct task_struct * p = (struct task_struct *) __data;
34 + journal_t *journal = from_timer(journal, t, j_commit_timer);
37 + wake_up_process(journal->j_task);
41 @@ -197,8 +197,7 @@ static int kjournald2(void *arg)
42 * Set up an interval timer which can be used to trigger a commit wakeup
43 * after the commit interval expires
45 - setup_timer(&journal->j_commit_timer, commit_timeout,
46 - (unsigned long)current);
47 + timer_setup(&journal->j_commit_timer, commit_timeout, 0);