mm/page-writeback.c: convert timers to use timer_setup()
authorKees Cook <keescook@chromium.org>
Thu, 16 Nov 2017 01:37:04 +0000 (17:37 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Nov 2017 02:21:05 +0000 (18:21 -0800)
In preparation for unconditionally passing the struct timer_list pointer
to all timer callbacks, switch to using the new timer_setup() and
from_timer() to pass the timer pointer explicitly.

Link: http://lkml.kernel.org/r/20171016225913.GA99214@beast
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page-writeback.c

index 231651a1486d4a5c7d52921d45d381d88be00652..83c746577aeab3cdf28f50df86584922d11dcfd5 100644 (file)
@@ -628,9 +628,9 @@ EXPORT_SYMBOL_GPL(wb_writeout_inc);
  * On idle system, we can be called long after we scheduled because we use
  * deferred timers so count with missed periods.
  */
  * On idle system, we can be called long after we scheduled because we use
  * deferred timers so count with missed periods.
  */
-static void writeout_period(unsigned long t)
+static void writeout_period(struct timer_list *t)
 {
 {
-       struct wb_domain *dom = (void *)t;
+       struct wb_domain *dom = from_timer(dom, t, period_timer);
        int miss_periods = (jiffies - dom->period_time) /
                                                 VM_COMPLETIONS_PERIOD_LEN;
 
        int miss_periods = (jiffies - dom->period_time) /
                                                 VM_COMPLETIONS_PERIOD_LEN;
 
@@ -653,8 +653,7 @@ int wb_domain_init(struct wb_domain *dom, gfp_t gfp)
 
        spin_lock_init(&dom->lock);
 
 
        spin_lock_init(&dom->lock);
 
-       setup_deferrable_timer(&dom->period_timer, writeout_period,
-                              (unsigned long)dom);
+       timer_setup(&dom->period_timer, writeout_period, TIMER_DEFERRABLE);
 
        dom->dirty_limit_tstamp = jiffies;
 
 
        dom->dirty_limit_tstamp = jiffies;