sg: add SG_FLAG_Q_AT_TAIL flag
authorDouglas Gilbert <dgilbert@interlog.com>
Wed, 4 Jun 2014 14:58:30 +0000 (10:58 -0400)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jul 2014 20:07:34 +0000 (22:07 +0200)
commit16070cc189c5e343696c29c8cff779e692cfcb8d
tree00edc84093c62557235b118fe8e3e28441c07dce
parent65c26a0f39695ba01d9693754f27ca76cc8a3ab5
sg: add SG_FLAG_Q_AT_TAIL flag

When the SG_IO ioctl was copied into the block layer and
later into the bsg driver, subtle differences emerged.

One difference is the way injected commands are queued through
the block layer (i.e. this is not SCSI device queueing nor SATA
NCQ). Summarizing:
   - SG_IO in the block layer: blk_exec*(at_head=false)
   - sg SG_IO: at_head=true
   - bsg SG_IO: at_head=true

Some time ago Boaz Harrosh introduced a sg v4 flag called
BSG_FLAG_Q_AT_TAIL to override the bsg driver default.
This patch does the equivalent for the sg driver.

ChangeLog:
     Introduce SG_FLAG_Q_AT_TAIL flag to cause commands
     to be injected into the block layer with
     at_head=false.

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/sg.c
include/scsi/sg.h