aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/scsi_ioctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index bda1497add4c..51bf5155ee75 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -290,6 +290,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
290 unsigned long start_time; 290 unsigned long start_time;
291 ssize_t ret = 0; 291 ssize_t ret = 0;
292 int writing = 0; 292 int writing = 0;
293 int at_head = 0;
293 struct request *rq; 294 struct request *rq;
294 char sense[SCSI_SENSE_BUFFERSIZE]; 295 char sense[SCSI_SENSE_BUFFERSIZE];
295 struct bio *bio; 296 struct bio *bio;
@@ -313,6 +314,8 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
313 case SG_DXFER_FROM_DEV: 314 case SG_DXFER_FROM_DEV:
314 break; 315 break;
315 } 316 }
317 if (hdr->flags & SG_FLAG_Q_AT_HEAD)
318 at_head = 1;
316 319
317 rq = blk_get_request(q, writing ? WRITE : READ, GFP_KERNEL); 320 rq = blk_get_request(q, writing ? WRITE : READ, GFP_KERNEL);
318 if (!rq) 321 if (!rq)
@@ -369,7 +372,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
369 * (if he doesn't check that is his problem). 372 * (if he doesn't check that is his problem).
370 * N.B. a non-zero SCSI status is _not_ necessarily an error. 373 * N.B. a non-zero SCSI status is _not_ necessarily an error.
371 */ 374 */
372 blk_execute_rq(q, bd_disk, rq, 0); 375 blk_execute_rq(q, bd_disk, rq, at_head);
373 376
374 hdr->duration = jiffies_to_msecs(jiffies - start_time); 377 hdr->duration = jiffies_to_msecs(jiffies - start_time);
375 378