|
64 | 64 | static DEFINE_MUTEX(drbd_main_mutex); |
65 | 65 | static int drbd_open(struct block_device *bdev, fmode_t mode); |
66 | 66 | static void drbd_release(struct gendisk *gd, fmode_t mode); |
67 | | -static void md_sync_timer_fn(unsigned long data); |
| 67 | +static void md_sync_timer_fn(struct timer_list *t); |
68 | 68 | static int w_bitmap_io(struct drbd_work *w, int unused); |
69 | 69 |
|
70 | 70 | MODULE_AUTHOR("Philipp Reisner <phil@linbit.com>, " |
@@ -2023,14 +2023,10 @@ void drbd_init_set_defaults(struct drbd_device *device) |
2023 | 2023 | device->unplug_work.cb = w_send_write_hint; |
2024 | 2024 | device->bm_io_work.w.cb = w_bitmap_io; |
2025 | 2025 |
|
2026 | | - setup_timer(&device->resync_timer, resync_timer_fn, |
2027 | | - (unsigned long)device); |
2028 | | - setup_timer(&device->md_sync_timer, md_sync_timer_fn, |
2029 | | - (unsigned long)device); |
2030 | | - setup_timer(&device->start_resync_timer, start_resync_timer_fn, |
2031 | | - (unsigned long)device); |
2032 | | - setup_timer(&device->request_timer, request_timer_fn, |
2033 | | - (unsigned long)device); |
| 2026 | + timer_setup(&device->resync_timer, resync_timer_fn, 0); |
| 2027 | + timer_setup(&device->md_sync_timer, md_sync_timer_fn, 0); |
| 2028 | + timer_setup(&device->start_resync_timer, start_resync_timer_fn, 0); |
| 2029 | + timer_setup(&device->request_timer, request_timer_fn, 0); |
2034 | 2030 |
|
2035 | 2031 | init_waitqueue_head(&device->misc_wait); |
2036 | 2032 | init_waitqueue_head(&device->state_wait); |
@@ -3721,9 +3717,9 @@ int drbd_md_test_flag(struct drbd_backing_dev *bdev, int flag) |
3721 | 3717 | return (bdev->md.flags & flag) != 0; |
3722 | 3718 | } |
3723 | 3719 |
|
3724 | | -static void md_sync_timer_fn(unsigned long data) |
| 3720 | +static void md_sync_timer_fn(struct timer_list *t) |
3725 | 3721 | { |
3726 | | - struct drbd_device *device = (struct drbd_device *) data; |
| 3722 | + struct drbd_device *device = from_timer(device, t, md_sync_timer); |
3727 | 3723 | drbd_device_post_work(device, MD_SYNC); |
3728 | 3724 | } |
3729 | 3725 |
|
|
0 commit comments