block/aoe: 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 <axboe@kernel.dk> Cc: "Ed L. Cashin" <ed.cashin@acm.org> Cc: linux-block@vger.kernel.org Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
cbb9d17875
commit
0e0cc9df86
|
@ -744,7 +744,7 @@ count_targets(struct aoedev *d, int *untainted)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rexmit_timer(ulong vp)
|
rexmit_timer(struct timer_list *timer)
|
||||||
{
|
{
|
||||||
struct aoedev *d;
|
struct aoedev *d;
|
||||||
struct aoetgt *t;
|
struct aoetgt *t;
|
||||||
|
@ -758,7 +758,7 @@ rexmit_timer(ulong vp)
|
||||||
int utgts; /* number of aoetgt descriptors (not slots) */
|
int utgts; /* number of aoetgt descriptors (not slots) */
|
||||||
int since;
|
int since;
|
||||||
|
|
||||||
d = (struct aoedev *) vp;
|
d = from_timer(d, timer, timer);
|
||||||
|
|
||||||
spin_lock_irqsave(&d->lock, flags);
|
spin_lock_irqsave(&d->lock, flags);
|
||||||
|
|
||||||
|
@ -1429,7 +1429,7 @@ aoecmd_ata_id(struct aoedev *d)
|
||||||
|
|
||||||
d->rttavg = RTTAVG_INIT;
|
d->rttavg = RTTAVG_INIT;
|
||||||
d->rttdev = RTTDEV_INIT;
|
d->rttdev = RTTDEV_INIT;
|
||||||
d->timer.function = rexmit_timer;
|
d->timer.function = (TIMER_FUNC_TYPE)rexmit_timer;
|
||||||
|
|
||||||
skb = skb_clone(skb, GFP_ATOMIC);
|
skb = skb_clone(skb, GFP_ATOMIC);
|
||||||
if (skb) {
|
if (skb) {
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include "aoe.h"
|
#include "aoe.h"
|
||||||
|
|
||||||
static void dummy_timer(ulong);
|
|
||||||
static void freetgt(struct aoedev *d, struct aoetgt *t);
|
static void freetgt(struct aoedev *d, struct aoetgt *t);
|
||||||
static void skbpoolfree(struct aoedev *d);
|
static void skbpoolfree(struct aoedev *d);
|
||||||
|
|
||||||
|
@ -146,11 +145,11 @@ aoedev_put(struct aoedev *d)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dummy_timer(ulong vp)
|
dummy_timer(struct timer_list *t)
|
||||||
{
|
{
|
||||||
struct aoedev *d;
|
struct aoedev *d;
|
||||||
|
|
||||||
d = (struct aoedev *)vp;
|
d = from_timer(d, t, timer);
|
||||||
if (d->flags & DEVFL_TKILL)
|
if (d->flags & DEVFL_TKILL)
|
||||||
return;
|
return;
|
||||||
d->timer.expires = jiffies + HZ;
|
d->timer.expires = jiffies + HZ;
|
||||||
|
@ -466,9 +465,7 @@ aoedev_by_aoeaddr(ulong maj, int min, int do_alloc)
|
||||||
INIT_WORK(&d->work, aoecmd_sleepwork);
|
INIT_WORK(&d->work, aoecmd_sleepwork);
|
||||||
spin_lock_init(&d->lock);
|
spin_lock_init(&d->lock);
|
||||||
skb_queue_head_init(&d->skbpool);
|
skb_queue_head_init(&d->skbpool);
|
||||||
init_timer(&d->timer);
|
timer_setup(&d->timer, dummy_timer, 0);
|
||||||
d->timer.data = (ulong) d;
|
|
||||||
d->timer.function = dummy_timer;
|
|
||||||
d->timer.expires = jiffies + HZ;
|
d->timer.expires = jiffies + HZ;
|
||||||
add_timer(&d->timer);
|
add_timer(&d->timer);
|
||||||
d->bufpool = NULL; /* defer to aoeblk_gdalloc */
|
d->bufpool = NULL; /* defer to aoeblk_gdalloc */
|
||||||
|
|
Loading…
Reference in New Issue