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_raid1.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_raid1.c')
| -rw-r--r-- | sys/dev/softraid_raid1.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c index 430c9ed033c..85a789ffc0c 100644 --- a/sys/dev/softraid_raid1.c +++ b/sys/dev/softraid_raid1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid1.c,v 1.4 2008/02/05 16:15:35 marco Exp $ */ +/* $OpenBSD: softraid_raid1.c,v 1.5 2008/02/05 16:49:25 marco Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * @@ -287,7 +287,6 @@ sr_raid1_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 ios, x, i, s, rt; @@ -407,26 +406,9 @@ ragain: if (wu->swu_state == SR_WU_REQUEUE) goto queued; - /* 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; - } - /* XXX deal with polling */ start: sr_raid_startwu(wu); queued: |
