From c81149bfaf6bc959dc6c3ab37be79d6f2e396818 Mon Sep 17 00:00:00 2001 From: ken Date: Tue, 13 Oct 1998 22:02:38 +0000 Subject: When we send a stop unit command to a device, send it as an ordered tag so that any transactions in front of the stop command get flushed to disk first. This will have no effect on devices that have tagged queueing turned off, or don't support tagged queueing. Reviewed by: gibbs --- sbin/camcontrol/camcontrol.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sbin/camcontrol') diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 66d56bc..3403b39 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: camcontrol.c,v 1.3 1998/10/03 19:15:53 ken Exp $ + * $Id: camcontrol.c,v 1.4 1998/10/13 16:23:26 ken Exp $ */ #include @@ -450,10 +450,17 @@ scsistart(struct cam_device *device, int startstop, int loadeject, ccb = cam_getccb(device); + /* + * If we're stopping, send an ordered tag so the drive in question + * will finish any previously queued writes before stopping. If + * the device isn't capable of tagged queueing, or if tagged + * queueing is turned off, the tag action is a no-op. + */ scsi_start_stop(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ startstop ? MSG_SIMPLE_Q_TAG : + MSG_ORDERED_Q_TAG, /* start/stop */ startstop, /* load_eject */ loadeject, /* immediate */ 0, -- cgit v1.1