Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59279
b: refs/heads/master
c: ac81864
h: refs/heads/master
i:
  59277: 1c1f931
  59275: e7a0c28
  59271: a1a9a46
  59263: a8fb20a
v: v3
  • Loading branch information
Alasdair G Kergon authored and Linus Torvalds committed Jul 12, 2007
1 parent 2e23265 commit e6580ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 028867ac28e51afc834a5931e7545c022557eded
refs/heads/master: ac818646d4be79123ad8dc5f1c4da8575d4960f8
12 changes: 5 additions & 7 deletions trunk/drivers/md/dm-delay.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

struct delay_c {
struct timer_list delay_timer;
struct semaphore timer_lock;
struct mutex timer_lock;
struct work_struct flush_expired_bios;
struct list_head delayed_bios;
atomic_t may_delay;
Expand Down Expand Up @@ -58,12 +58,12 @@ static void handle_delayed_timer(unsigned long data)

static void queue_timeout(struct delay_c *dc, unsigned long expires)
{
down(&dc->timer_lock);
mutex_lock(&dc->timer_lock);

if (!timer_pending(&dc->delay_timer) || expires < dc->delay_timer.expires)
mod_timer(&dc->delay_timer, expires);

up(&dc->timer_lock);
mutex_unlock(&dc->timer_lock);
}

static void flush_bios(struct bio *bio)
Expand Down Expand Up @@ -193,13 +193,11 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad;
}

init_timer(&dc->delay_timer);
dc->delay_timer.function = handle_delayed_timer;
dc->delay_timer.data = (unsigned long)dc;
setup_timer(&dc->delay_timer, handle_delayed_timer, (unsigned long)dc);

INIT_WORK(&dc->flush_expired_bios, flush_expired_bios);
INIT_LIST_HEAD(&dc->delayed_bios);
init_MUTEX(&dc->timer_lock);
mutex_init(&dc->timer_lock);
atomic_set(&dc->may_delay, 1);

ti->private = dc;
Expand Down

0 comments on commit e6580ed

Please sign in to comment.