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
This commit is contained in:
Kenneth D. Merry 1998-10-13 22:02:38 +00:00
parent 60a899a075
commit 8e3278cbd6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=40319

View File

@ -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 <sys/ioctl.h>
@ -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,