diff options
author | ken <ken@FreeBSD.org> | 1998-10-13 22:02:38 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 1998-10-13 22:02:38 +0000 |
commit | c81149bfaf6bc959dc6c3ab37be79d6f2e396818 (patch) | |
tree | f39837e7be75c6f18248aad422f224a89f433702 | |
parent | 3edc6b124999ce18cf5dc9d7981d207e3fab8b2e (diff) | |
download | FreeBSD-src-c81149bfaf6bc959dc6c3ab37be79d6f2e396818.zip FreeBSD-src-c81149bfaf6bc959dc6c3ab37be79d6f2e396818.tar.gz |
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
-rw-r--r-- | sbin/camcontrol/camcontrol.c | 11 |
1 files changed, 9 insertions, 2 deletions
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 <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, |