diff options
author | 2008-02-05 16:49:25 +0000 | |
---|---|---|
committer | 2008-02-05 16:49:25 +0000 | |
commit | 53dea72cbb9e8ec6d6706d79016dd3c6419d75e4 (patch) | |
tree | 809bb69a4bd42767038768b66b99cd0cc2274322 /sys/dev/softraid_raid0.c | |
parent | Add strip size to debug print. (diff) | |
download | wireguard-openbsd-53dea72cbb9e8ec6d6706d79016dd3c6419d75e4.tar.xz wireguard-openbsd-53dea72cbb9e8ec6d6706d79016dd3c6419d75e4.zip |
Shave off a few more bytes by moving IO collision detection into a generic
fucntion. Fix bug in the crypto code that could casuse data corruption as
a bonus, bad cut & past tedu!
Diffstat (limited to 'sys/dev/softraid_raid0.c')
-rw-r--r-- | sys/dev/softraid_raid0.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c index 97833c47bdd..d8994687878 100644 --- a/sys/dev/softraid_raid0.c +++ b/sys/dev/softraid_raid0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid0.c,v 1.7 2008/02/05 16:15:35 marco Exp $ */ +/* $OpenBSD: softraid_raid0.c,v 1.8 2008/02/05 16:49:25 marco Exp $ */ /* * Copyright (c) 2008 Marco Peereboom <marco@peereboom.us> * @@ -203,7 +203,6 @@ sr_raid0_rw(struct sr_workunit *wu) { struct sr_discipline *sd = wu->swu_dis; struct scsi_xfer *xs = wu->swu_xs; - struct sr_workunit *wup; struct sr_ccb *ccb; struct sr_chunk *scp; int s; @@ -299,24 +298,9 @@ sr_raid0_rw(struct sr_workunit *wu) s = splbio(); - /* walk queue backwards and fill in collider if we have one */ - TAILQ_FOREACH_REVERSE(wup, &sd->sd_wu_pendq, sr_wu_list, swu_link) { - if (wu->swu_blk_end < wup->swu_blk_start || - wup->swu_blk_end < wu->swu_blk_start) - continue; - - /* we have an LBA collision, defer wu */ - wu->swu_state = SR_WU_DEFERRED; - if (wup->swu_collider) - /* wu is on deferred queue, append to last wu */ - while (wup->swu_collider) - wup = wup->swu_collider; - - wup->swu_collider = wu; - TAILQ_INSERT_TAIL(&sd->sd_wu_defq, wu, swu_link); - sd->sd_wu_collisions++; + if (sr_check_io_collision(wu)) goto queued; - } + sr_raid_startwu(wu); queued: splx(s); |