1 ext4: 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: Reviewed-by: Jan Kara <jack@suse.cz>
12 Cc: Andreas Dilger <adilger.kernel@dilger.ca>
13 Cc: linux-ext4@vger.kernel.org
15 fs/ext4/super.c | 14 +++++---------
16 1 file changed, 5 insertions(+), 9 deletions(-)
18 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
19 index b5d393321b7b..759281cec51f 100644
22 @@ -2793,14 +2793,11 @@ static int ext4_feature_set_ok(struct super_block *sb, int readonly)
23 * This function is called once a day if we have errors logged
26 -static void print_daily_error_info(unsigned long arg)
27 +static void print_daily_error_info(struct timer_list *t)
29 - struct super_block *sb = (struct super_block *) arg;
30 - struct ext4_sb_info *sbi;
31 - struct ext4_super_block *es;
35 + struct ext4_sb_info *sbi = from_timer(sbi, t, s_err_report);
36 + struct super_block *sb = sbi->s_sb;
37 + struct ext4_super_block *es = sbi->s_es;
39 if (es->s_error_count)
40 /* fsck newer than v1.41.13 is needed to clean this condition. */
41 @@ -3982,8 +3979,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
42 get_random_bytes(&sbi->s_next_generation, sizeof(u32));
43 spin_lock_init(&sbi->s_next_gen_lock);
45 - setup_timer(&sbi->s_err_report, print_daily_error_info,
46 - (unsigned long) sb);
47 + timer_setup(&sbi->s_err_report, print_daily_error_info, 0);
49 /* Register extent status tree shrinker */
50 if (ext4_es_register_shrinker(sbi))