diff options
author | 2013-03-25 16:01:48 +0000 | |
---|---|---|
committer | 2013-03-25 16:01:48 +0000 | |
commit | 4eafb0731691362af9407f6bb9409f4c53145db7 (patch) | |
tree | ac18fbcec612fb8f4d0b991a3ce09ac054f20b16 /sys/dev/softraid.c | |
parent | Revert the command-prefix change which breaks sequences of commands. (diff) | |
download | wireguard-openbsd-4eafb0731691362af9407f6bb9409f4c53145db7.tar.xz wireguard-openbsd-4eafb0731691362af9407f6bb9409f4c53145db7.zip |
Factor out the code that is used to recreate work units - one copy of the
code is sufficient.
ok krw@
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 5c23b464ce7..74d7f37a6fb 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.290 2013/03/10 09:05:12 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.291 2013/03/25 16:01:48 jsing Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -4128,6 +4128,28 @@ sr_raid_startwu(struct sr_workunit *wu) } void +sr_raid_recreate_wu(struct sr_workunit *wu) +{ + struct sr_discipline *sd = wu->swu_dis; + struct sr_workunit *wup = wu; + + /* + * Recreate a work unit by releasing the associated CCBs and reissuing + * the SCSI I/O request. This process is then repeated for all of the + * colliding work units. + */ + do { + sr_wu_release_ccbs(wup); + + wup->swu_state = SR_WU_REQUEUE; + if (sd->sd_scsi_rw(wup)) + panic("could not requeue I/O"); + + wup = wup->swu_collider; + } while (wup); +} + +void sr_set_chunk_state(struct sr_discipline *sd, int c, int new_state) { int old_state, s; |