All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>, linux-scsi@vger.kernel.org
Cc: Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH 2/6] scsi: remove scsi_next_command
Date: Thu, 06 Nov 2014 09:21:05 +0100	[thread overview]
Message-ID: <545B2F71.7020808@suse.de> (raw)
In-Reply-To: <1415259630-20784-3-git-send-email-hch@lst.de>

On 11/06/2014 08:40 AM, Christoph Hellwig wrote:
> There's only one caller left, so inline it and reduce the blk-mq vs !blk-mq
> diff a litte bit.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/scsi/scsi_lib.c  | 18 ++++--------------
>  drivers/scsi/scsi_priv.h |  1 -
>  2 files changed, 4 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 38f8c85..1a3546e8 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -543,17 +543,6 @@ static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)
>  	put_device(&sdev->sdev_gendev);
>  }
>  
> -void scsi_next_command(struct scsi_cmnd *cmd)
> -{
> -	struct scsi_device *sdev = cmd->device;
> -	struct request_queue *q = sdev->request_queue;
> -
> -	scsi_put_command(cmd);
> -	scsi_run_queue(q);
> -
> -	put_device(&sdev->sdev_gendev);
> -}
> -
>  void scsi_run_host_queues(struct Scsi_Host *shost)
>  {
>  	struct scsi_device *sdev;
> @@ -731,8 +720,6 @@ static bool scsi_end_request(struct request *req, int error,
>  			kblockd_schedule_work(&sdev->requeue_work);
>  		else
>  			blk_mq_start_stopped_hw_queues(q, true);
> -
> -		put_device(&sdev->sdev_gendev);
>  	} else {
>  		unsigned long flags;
>  
> @@ -744,9 +731,12 @@ static bool scsi_end_request(struct request *req, int error,
>  		spin_unlock_irqrestore(q->queue_lock, flags);
>  
>  		scsi_release_buffers(cmd);
> -		scsi_next_command(cmd);
> +
> +		scsi_put_command(cmd);
> +		scsi_run_queue(q);
>  	}
>  
> +	put_device(&sdev->sdev_gendev);
>  	return false;
>  }
>  
Hmm? Isn't there a scsi_put_comand() too many?
You dropped it from the 'if' branch, moved it out of
the condition, but kept in in the 'else' branch ...

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-11-06  8:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  7:40 I/O path cleanup V2 Christoph Hellwig
2014-11-06  7:40 ` [PATCH 1/6] scsi: don't use scsi_next_command in scsi_reset_provider Christoph Hellwig
2014-11-06  8:18   ` Hannes Reinecke
2014-11-06  7:40 ` [PATCH 2/6] scsi: remove scsi_next_command Christoph Hellwig
2014-11-06  8:21   ` Hannes Reinecke [this message]
2014-11-06 15:34     ` Christoph Hellwig
2014-11-11 16:37       ` Christoph Hellwig
2014-11-11 19:02         ` Hannes Reinecke
2014-11-06  7:40 ` [PATCH 3/6] scsi: clean up S/G table freeing Christoph Hellwig
2014-11-06  8:23   ` Hannes Reinecke
2014-11-18 18:14   ` Bart Van Assche
2014-11-20  8:16     ` Christoph Hellwig
2014-11-06  7:40 ` [PATCH 4/6] scsi: stop passing a gfp_mask argument down the command setup path Christoph Hellwig
2014-11-06  8:24   ` Hannes Reinecke
2014-11-06  7:40 ` [PATCH 5/6] scsi: move scsi_dispatch_cmd to scsi_lib.c Christoph Hellwig
2014-11-06  8:25   ` Hannes Reinecke
2014-11-06  7:40 ` [PATCH 6/6] scsi: move more requeue handling into scsi_requeue_command Christoph Hellwig
2014-11-06  8:26   ` Hannes Reinecke

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=545B2F71.7020808@suse.de \
    --to=hare@suse.de \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --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.