All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
	USB list <linux-usb@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH 0/4] Use of new scsi_allocate_command
Date: Thu, 01 May 2008 18:13:13 +0300	[thread overview]
Message-ID: <4819DE09.4080800@panasas.com> (raw)
In-Reply-To: <4819DA39.70505@panasas.com>

On Thu, May 01 2008 at 17:56 +0300, Boaz Harrosh <bharrosh@panasas.com> wrote:
> 
> ---
> From: Boaz Harrosh <bharrosh@panasas.com>
> Subject: [PATCH 4/4] gdth: Use scsi_allocate_command for private command allocation
> 
> In gdth_execute() use scsi_allocate_command for allocation of
> a command. To be insulated from future scsi_cmnd construction
> considerations.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
<snip>

Rrrr wrong patch sorry for the noise. Here is a compiling one

---
From: Boaz Harrosh <bharrosh@panasas.com>
Subject: [PATCH] gdth: Use scsi_get_command for private command allocation

In gdth_execute() use scsi_get_command for allocation of
a command. To be insulated from future scsi_cmnd construction
considerations.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 drivers/scsi/gdth.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 35ad3bf..3cfbab6 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -447,17 +447,10 @@ int gdth_execute(gdth_ha_str *ha, gdth_cmd_str *gdtcmd, char *cmnd,
     DECLARE_COMPLETION_ONSTACK(wait);
     int rval;
 
-    scp = kzalloc(sizeof(*scp), GFP_KERNEL);
+    scp = scsi_get_command(ha->sdev, GFP_KERNEL);
     if (!scp)
         return -ENOMEM;
 
-    scp->sense_buffer = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
-    if (!scp->sense_buffer) {
-	kfree(scp);
-	return -ENOMEM;
-    }
-
-    scp->device = ha->sdev;
     memset(&cmndinfo, 0, sizeof(cmndinfo));
 
     /* use request field to save the ptr. to completion struct. */
@@ -477,8 +470,8 @@ int gdth_execute(gdth_ha_str *ha, gdth_cmd_str *gdtcmd, char *cmnd,
     rval = cmndinfo.status;
     if (info)
         *info = cmndinfo.info;
-    kfree(scp->sense_buffer);
-    kfree(scp);
+
+    scsi_put_command(scp);
     return rval;
 }
 
-- 
1.5.3.3


  reply	other threads:[~2008-05-01 15:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4819C9DB.60104@panasas.com>
2008-05-01 13:56 ` [PATCH 1/4] scsi_free_command API change - Don't support GFP_DMA Boaz Harrosh
2008-05-01 13:58 ` [PATCH 2/4] isd200: Use new scsi_allocate_command() Boaz Harrosh
2008-05-01 14:02 ` [PATCH 3/3] gdth: consolidate __gdth_execute && gdth_execute Boaz Harrosh
2008-05-01 14:06 ` [PATCH 4/4] gdth: Use scsi_allocate_command for private command allocation Boaz Harrosh
2008-05-01 14:24 ` [PATCH 0/4] Use of new scsi_allocate_command James Bottomley
     [not found]   ` <1209651854.3067.8.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-05-01 14:56     ` Boaz Harrosh
2008-05-01 15:13       ` Boaz Harrosh [this message]
2008-05-01 15:22       ` James Bottomley
2008-05-01 15:36         ` Boaz Harrosh
     [not found]           ` <4819E371.2040403-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2008-05-01 15:47             ` James Bottomley
2008-05-01 15:59               ` Boaz Harrosh
2008-05-01 16:02                 ` James Bottomley
     [not found]                   ` <1209657731.3067.19.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-05-01 16:25                     ` Boaz Harrosh
2008-05-01 16:38                       ` James Bottomley
2008-05-01 17:06                         ` Boaz Harrosh
2008-05-01 17:33                           ` James Bottomley
     [not found]                             ` <1209663229.14864.18.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-05-01 18:14                               ` Boaz Harrosh
2008-05-01 20:32                                 ` James Bottomley
     [not found]                                   ` <1209673979.14864.23.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-05-01 21:41                                     ` Andi Kleen
2008-05-01 13:47 Boaz Harrosh

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=4819DE09.4080800@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=andi@firstfloor.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mdharm-usb@one-eyed-alien.net \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.