From: Patrick Mansfield <patmans@us.ibm.com>
To: James Bottomley <James.Bottomley@steeleye.com>,
linux-scsi@vger.kernel.org
Subject: [PATCH] scsi-misc-2.5 fold scsi_alloc_cmd into __scsi_get_command
Date: Thu, 24 Apr 2003 10:03:41 -0700 [thread overview]
Message-ID: <20030424100341.B32134@beaverton.ibm.com> (raw)
In-Reply-To: <20030424100317.A32134@beaverton.ibm.com>; from patmans@us.ibm.com on Thu, Apr 24, 2003 at 10:03:17AM -0700
Patch against scsi-misc-2.5
scsi_alloc_cmd is real simple now, just fold it into __scsi_get_command.
diff -purN -X /home/patman/dontdiff rmhost_flock-2.5-cur/drivers/scsi/scsi.c rmsacmd-2.5-cur/drivers/scsi/scsi.c
--- rmhost_flock-2.5-cur/drivers/scsi/scsi.c Thu Apr 24 09:14:47 2003
+++ rmsacmd-2.5-cur/drivers/scsi/scsi.c Thu Apr 24 09:15:07 2003
@@ -254,23 +254,6 @@ static struct scsi_host_cmd_pool scsi_cm
static DECLARE_MUTEX(host_cmd_pool_mutex);
-static struct scsi_cmnd *scsi_alloc_cmd(struct scsi_device *sdev,
- int gfp_mask)
-{
- struct scsi_cmnd *cmd;
-
- /*
- * Use any spare command first.
- */
- cmd = sdev->spare_cmd;
- if (cmd != NULL)
- sdev->spare_cmd = NULL;
- else
- cmd = kmem_cache_alloc(sdev->host->cmd_pool->slab,
- gfp_mask | sdev->host->cmd_pool->gfp_mask);
- return cmd;
-}
-
/*
* Function: __scsi_get_command()
*
@@ -286,7 +269,17 @@ static struct scsi_cmnd *scsi_alloc_cmd(
*/
struct scsi_cmnd *__scsi_get_command(struct scsi_device *dev, int gfp_mask)
{
- struct scsi_cmnd *cmd = scsi_alloc_cmd(dev, gfp_mask);
+ struct scsi_cmnd *cmd;
+
+ /*
+ * Use any spare command first.
+ */
+ cmd = dev->spare_cmd;
+ if (cmd != NULL)
+ dev->spare_cmd = NULL;
+ else
+ cmd = kmem_cache_alloc(dev->host->cmd_pool->slab,
+ gfp_mask | dev->host->cmd_pool->gfp_mask);
if (likely(cmd != NULL)) {
memset(cmd, 0, sizeof(*cmd));
next prev parent reply other threads:[~2003-04-24 16:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-24 17:02 [PATCH] scsi-misc-2.5 remove scsi_device list_lock Patrick Mansfield
2003-04-24 17:03 ` [PATCH] scsi-misc-2.5 user per-device spare command Patrick Mansfield
2003-04-24 17:03 ` Patrick Mansfield [this message]
2003-04-25 10:12 ` Christoph Hellwig
2003-04-25 14:12 ` Luben Tuikov
2003-04-25 16:50 ` Patrick Mansfield
2003-04-25 16:56 ` Christoph Hellwig
2003-04-25 17:45 ` Luben Tuikov
2003-04-25 18:00 ` Patrick Mansfield
2003-04-25 18:36 ` Luben Tuikov
2003-04-25 16:37 ` Patrick Mansfield
2003-04-25 16:50 ` Christoph Hellwig
2003-04-25 16:57 ` James Bottomley
2003-04-25 20:49 ` Patrick Mansfield
2003-04-25 17:38 ` Luben Tuikov
2003-04-25 10:12 ` [PATCH] scsi-misc-2.5 remove scsi_device list_lock Christoph Hellwig
2003-04-25 10:47 ` Jens Axboe
2003-04-25 16:53 ` Patrick Mansfield
2003-04-25 17:20 ` Jens Axboe
2003-04-25 14:00 ` Luben Tuikov
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=20030424100341.B32134@beaverton.ibm.com \
--to=patmans@us.ibm.com \
--cc=James.Bottomley@steeleye.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 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.