Fix up descriptions.
[ext4-patch-queue.git] / ext4-convert-timers-to-use-timer-setup
blobdb0ab6c9444f51a79e1392bc9e2de83f8c671acf
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
14 ---
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
20 --- a/fs/ext4/super.c
21 +++ b/fs/ext4/super.c
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
24   * on the file system
25   */
26 -static void print_daily_error_info(unsigned long arg)
27 +static void print_daily_error_info(struct timer_list *t)
28  {
29 -       struct super_block *sb = (struct super_block *) arg;
30 -       struct ext4_sb_info *sbi;
31 -       struct ext4_super_block *es;
33 -       sbi = EXT4_SB(sb);
34 -       es = sbi->s_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))
51 -- 
52 2.7.4
55 -- 
56 Kees Cook
57 Pixel Security