public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 4/4] update scsi-ml's scsi_init_io
@ 2005-06-04  1:33 Mike Christie
  0 siblings, 0 replies; only message in thread
From: Mike Christie @ 2005-06-04  1:33 UTC (permalink / raw)
  To: dm-devel, linux-scsi, axboe

All REQ_BLOCK_PC requests are bio backed now.

This patch was made against 2.6.12-rc5 but works with scsi-misc.

--- linux-2.6.12-rc5.orig/drivers/scsi/scsi_lib.c	2005-06-03 03:23:47.000000000 -0700
+++ linux-2.6.12-rc5/drivers/scsi/scsi_lib.c	2005-06-03 14:31:41.000000000 -0700
@@ -920,24 +920,19 @@ static int scsi_init_io(struct scsi_cmnd
 	int		   count;
 
 	/*
-	 * if this is a rq->data based REQ_BLOCK_PC, setup for a non-sg xfer
+	 * we use scatter-gather for all requests with data
+	 * (it makes highmem I/O easier to support without kmapping pages)
 	 */
-	if ((req->flags & REQ_BLOCK_PC) && !req->bio) {
-		cmd->request_bufflen = req->data_len;
-		cmd->request_buffer = req->data;
-		req->buffer = req->data;
-		cmd->use_sg = 0;
+	cmd->use_sg = req->nr_phys_segments;
+	if (!cmd->use_sg) {
+		BUG_ON(req->bio || req->data);
+		cmd->request_bufflen = 0;
+		cmd->request_buffer = NULL;
+		req->buffer = NULL;
 		return 0;
 	}
 
 	/*
-	 * we used to not use scatter-gather for single segment request,
-	 * but now we do (it makes highmem I/O easier to support without
-	 * kmapping pages)
-	 */
-	cmd->use_sg = req->nr_phys_segments;
-
-	/*
 	 * if sg table allocation fails, requeue request later.
 	 */
 	sgpnt = scsi_alloc_sgtable(cmd, GFP_ATOMIC);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-06-04  1:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-04  1:33 [PATCH RFC 4/4] update scsi-ml's scsi_init_io Mike Christie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox