public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: dm-devel@redhat.com, linux-scsi@vger.kernel.org, axboe@suse.de
Subject: [PATCH RFC 4/4] update scsi-ml's scsi_init_io
Date: Fri, 03 Jun 2005 18:33:40 -0700	[thread overview]
Message-ID: <1117848820.23706.11.camel@mina> (raw)

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);

                 reply	other threads:[~2005-06-04  1:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1117848820.23706.11.camel@mina \
    --to=michaelc@cs.wisc.edu \
    --cc=axboe@suse.de \
    --cc=dm-devel@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox