diff options
author | 2013-05-21 15:01:52 +0000 | |
---|---|---|
committer | 2013-05-21 15:01:52 +0000 | |
commit | 60781f8c9351fdbfab4b17cb75d0d37413c4af30 (patch) | |
tree | 8110a85c5d57a7173c144d2e31e6becdb8c4dda7 /sys/dev/softraid_raid0.c | |
parent | Add a driver for the am335x timers, to be used by the beaglebone. (diff) | |
download | wireguard-openbsd-60781f8c9351fdbfab4b17cb75d0d37413c4af30.tar.xz wireguard-openbsd-60781f8c9351fdbfab4b17cb75d0d37413c4af30.zip |
Provide a function that handles the scheduling of work units. This
simplifies the discipline code, avoids code duplication and moves the
scheduling logic into a single location.
ok krw@
Diffstat (limited to 'sys/dev/softraid_raid0.c')
-rw-r--r-- | sys/dev/softraid_raid0.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c index 98cd65c9677..90cce39bf1c 100644 --- a/sys/dev/softraid_raid0.c +++ b/sys/dev/softraid_raid0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid0.c,v 1.39 2013/03/31 15:44:52 jsing Exp $ */ +/* $OpenBSD: softraid_raid0.c,v 1.40 2013/05/21 15:01:53 jsing Exp $ */ /* * Copyright (c) 2008 Marco Peereboom <marco@peereboom.us> * @@ -120,7 +120,6 @@ sr_raid0_rw(struct sr_workunit *wu) struct scsi_xfer *xs = wu->swu_xs; struct sr_ccb *ccb; struct sr_chunk *scp; - int s; daddr64_t blk, lbaoffs, strip_no, chunk, stripoffs; daddr64_t strip_size, no_chunk, chunkoffs, physoffs; daddr64_t strip_bits, length, leftover; @@ -187,15 +186,10 @@ sr_raid0_rw(struct sr_workunit *wu) length = MIN(leftover,strip_size); } - s = splbio(); + sr_schedule_wu(wu); - if (sr_check_io_collision(wu)) - goto queued; - - sr_raid_startwu(wu); -queued: - splx(s); return (0); + bad: /* wu is unwound by sr_wu_put */ return (1); |