aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Battersby <tonyb@cybernetics.com>2018-07-12 18:09:21 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2018-07-12 23:08:13 -0400
commit8e4a4189ce02fe53b6f3ffcc1ac5a3a9967f2611 (patch)
tree3f6b5889459eeb41e8b16a3b84f0edbdb6b84f2d
parentc170e5a8d222537e98aa8d4fddb667ff7a2ee114 (diff)
scsi: sg: update comment for blk_get_request()
The calling convention of blk_get_request() has changed in lk 4.18; update the comment in sg.c to match. Fixes: ff005a066240 ("block: sanitize blk_get_request calling conventions") Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/sg.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 2962a38c5068..ba9ba0e04f42 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1741,15 +1741,11 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
1741 * 1741 *
1742 * With scsi-mq enabled, there are a fixed number of preallocated 1742 * With scsi-mq enabled, there are a fixed number of preallocated
1743 * requests equal in number to shost->can_queue. If all of the 1743 * requests equal in number to shost->can_queue. If all of the
1744 * preallocated requests are already in use, then using GFP_ATOMIC with 1744 * preallocated requests are already in use, then blk_get_request()
1745 * blk_get_request() will return -EWOULDBLOCK, whereas using GFP_KERNEL 1745 * will sleep until an active command completes, freeing up a request.
1746 * will cause blk_get_request() to sleep until an active command 1746 * Although waiting in an asynchronous interface is less than ideal, we
1747 * completes, freeing up a request. Neither option is ideal, but 1747 * do not want to use BLK_MQ_REQ_NOWAIT here because userspace might
1748 * GFP_KERNEL is the better choice to prevent userspace from getting an 1748 * not expect an EWOULDBLOCK from this condition.
1749 * unexpected EWOULDBLOCK.
1750 *
1751 * With scsi-mq disabled, blk_get_request() with GFP_KERNEL usually
1752 * does not sleep except under memory pressure.
1753 */ 1749 */
1754 rq = blk_get_request(q, hp->dxfer_direction == SG_DXFER_TO_DEV ? 1750 rq = blk_get_request(q, hp->dxfer_direction == SG_DXFER_TO_DEV ?
1755 REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0); 1751 REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);