diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2013-05-21 14:36:11 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2013-05-21 14:36:11 +0000 |
commit | 137df0ad117c9873dc54d072904fbcb3ccee2089 (patch) | |
tree | 659c8c0776c7abe0b26d2929884100ef7d197b81 | |
parent | 5d78a47daf36d5057456abaca950776be8f9f7b6 (diff) |
Make the sr_raid_startwu() function handle deferred work units, instead of
the caller having to handle the state changes.
-rw-r--r-- | sys/dev/softraid.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 69a397fdb27..d81dbebef84 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.304 2013/05/21 14:30:00 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.305 2013/05/21 14:36:10 jsing Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -2288,8 +2288,6 @@ sr_wu_done_callback(void *arg1, void *arg2) sr_raid_recreate_wu(wu->swu_collider); /* XXX Should the collider be failed if this xs failed? */ - wu->swu_collider->swu_state = SR_WU_INPROGRESS; - TAILQ_REMOVE(&sd->sd_wu_defq, wu->swu_collider, swu_link); sr_raid_startwu(wu->swu_collider); } @@ -4171,14 +4169,12 @@ sr_raid_startwu(struct sr_workunit *wu) splassert(IPL_BIO); - if (wu->swu_state == SR_WU_RESTART) - /* - * no need to put the wu on the pending queue since we - * are restarting the io - */ - ; - else - /* move wu to pending queue */ + if (wu->swu_state == SR_WU_DEFERRED) { + TAILQ_REMOVE(&sd->sd_wu_defq, wu, swu_link); + wu->swu_state = SR_WU_INPROGRESS; + } + + if (wu->swu_state != SR_WU_RESTART) TAILQ_INSERT_TAIL(&sd->sd_wu_pendq, wu, swu_link); /* start all individual ios */ |