Commit bca237a5 authored by Kees Cook's avatar Kees Cook

block/laptop_mode: Convert timers to use timer_setup()

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.

Cc: Jens Axboe <>
Cc: Michal Hocko <>
Cc: Andrew Morton <>
Cc: Jan Kara <>
Cc: Johannes Weiner <>
Cc: Nicholas Piggin <>
Cc: Vladimir Davydov <>
Cc: Matthew Wilcox <>
Cc: Jeff Layton <>
Signed-off-by: default avatarKees Cook <>
parent 1e9aa74e
......@@ -863,9 +863,9 @@ static void blk_queue_usage_counter_release(struct percpu_ref *ref)
static void blk_rq_timed_out_timer(unsigned long data)
static void blk_rq_timed_out_timer(struct timer_list *t)
struct request_queue *q = (struct request_queue *)data;
struct request_queue *q = from_timer(q, t, timeout);
......@@ -901,9 +901,9 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
q->backing_dev_info->name = "block";
q->node = node_id;
laptop_mode_timer_fn, (unsigned long) q);
setup_timer(&q->timeout, blk_rq_timed_out_timer, (unsigned long) q);
laptop_mode_timer_fn, 0);
timer_setup(&q->timeout, blk_rq_timed_out_timer, 0);
INIT_WORK(&q->timeout_work, NULL);
......@@ -308,7 +308,7 @@ static inline void cgroup_writeback_umount(void)
void laptop_io_completion(struct backing_dev_info *info);
void laptop_sync_completion(void);
void laptop_mode_sync(struct work_struct *work);
void laptop_mode_timer_fn(unsigned long data);
void laptop_mode_timer_fn(struct timer_list *t);
static inline void laptop_sync_completion(void) { }
......@@ -1993,11 +1993,12 @@ int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,
void laptop_mode_timer_fn(unsigned long data)
void laptop_mode_timer_fn(struct timer_list *t)
struct request_queue *q = (struct request_queue *)data;
struct backing_dev_info *backing_dev_info =
from_timer(backing_dev_info, t, laptop_mode_wb_timer);
wakeup_flusher_threads_bdi(q->backing_dev_info, WB_REASON_LAPTOP_TIMER);
wakeup_flusher_threads_bdi(backing_dev_info, WB_REASON_LAPTOP_TIMER);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment