linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Bart Van Assche <bart.vanassche@sandisk.com>,
	James Bottomley <james.bottomley@hansenpartnership.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Christoph Hellwig <hch@infradead.org>,
	Hannes Reinecke <hare@suse.de>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	James Smart <james.smart@emulex.com>
Subject: Re: [PATCH 1/2] scsi_transport_fc: Introduce scsi_host_{get,put}()
Date: Tue, 24 Nov 2015 13:43:32 +0100	[thread overview]
Message-ID: <1448369012.2877.28.camel@suse.de> (raw)
In-Reply-To: <564F9190.5090103@sandisk.com>

On Fri, 2015-11-20 at 13:33 -0800, Bart Van Assche wrote:
> Use scsi_host_{get,put}() instead of open-coding these functions.
> Compile-tested only.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: James Smart <james.smart@emulex.com>
> Cc: stable <stable@vger.kernel.org>
> ---
>  drivers/scsi/scsi_transport_fc.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_transport_fc.c
> b/drivers/scsi/scsi_transport_fc.c
> index 24eaaf6..8a88226 100644
> --- a/drivers/scsi/scsi_transport_fc.c
> +++ b/drivers/scsi/scsi_transport_fc.c
> @@ -2586,7 +2586,7 @@ fc_rport_final_delete(struct work_struct *work)
>  	transport_remove_device(dev);
>  	device_del(dev);
>  	transport_destroy_device(dev);
> -	put_device(&shost->shost_gendev);	/* for fc_host-
> >rport list */
> +	scsi_host_put(shost);			/* for fc_host-
> >rport list */
>  	put_device(dev);			/* for self-
> reference */
>  }
>  
> @@ -2650,7 +2650,7 @@ fc_rport_create(struct Scsi_Host *shost, int
> channel,
>  	else
>  		rport->scsi_target_id = -1;
>  	list_add_tail(&rport->peers, &fc_host->rports);
> -	get_device(&shost->shost_gendev);	/* for fc_host-
> >rport list */
> +	scsi_host_get(shost);			/* for fc_host-
> >rport list */
>  
>  	spin_unlock_irqrestore(shost->host_lock, flags);
>  
> @@ -2685,7 +2685,7 @@ delete_rport:
>  	transport_destroy_device(dev);
>  	spin_lock_irqsave(shost->host_lock, flags);
>  	list_del(&rport->peers);
> -	put_device(&shost->shost_gendev);	/* for fc_host-
> >rport list */
> +	scsi_host_put(shost);			/* for fc_host-
> >rport list */
>  	spin_unlock_irqrestore(shost->host_lock, flags);
>  	put_device(dev->parent);
>  	kfree(rport);
> @@ -3383,7 +3383,7 @@ fc_vport_setup(struct Scsi_Host *shost, int
> channel, struct device *pdev,
>  	fc_host->npiv_vports_inuse++;
>  	vport->number = fc_host->next_vport_number++;
>  	list_add_tail(&vport->peers, &fc_host->vports);
> -	get_device(&shost->shost_gendev);	/* for fc_host-
> >vport list */
> +	scsi_host_get(shost);			/* for fc_host-
> >vport list */
>  
>  	spin_unlock_irqrestore(shost->host_lock, flags);
>  
> @@ -3441,7 +3441,7 @@ delete_vport:
>  	transport_destroy_device(dev);
>  	spin_lock_irqsave(shost->host_lock, flags);
>  	list_del(&vport->peers);
> -	put_device(&shost->shost_gendev);	/* for fc_host-
> >vport list */
> +	scsi_host_put(shost);			/* for fc_host-
> >vport list */
>  	fc_host->npiv_vports_inuse--;
>  	spin_unlock_irqrestore(shost->host_lock, flags);
>  	put_device(dev->parent);
> @@ -3504,7 +3504,7 @@ fc_vport_terminate(struct fc_vport *vport)
>  		vport->flags |= FC_VPORT_DELETED;
>  		list_del(&vport->peers);
>  		fc_host->npiv_vports_inuse--;
> -		put_device(&shost->shost_gendev);  /* for fc_host-
> >vport list */
> +		scsi_host_put(shost);		/* for fc_host-
> >vport list */
>  	}
>  	spin_unlock_irqrestore(shost->host_lock, flags);
>  

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
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

  parent reply	other threads:[~2015-11-24 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 21:30 [PATCH 0/2] Fix a scsi_host_dev_release() memory leak Bart Van Assche
2015-11-20 21:33 ` [PATCH 1/2] scsi_transport_fc: Introduce scsi_host_{get,put}() Bart Van Assche
2015-11-22 15:03   ` Christoph Hellwig
2015-11-24 12:43   ` Johannes Thumshirn [this message]
2015-11-30 17:34   ` Martin K. Petersen
2015-11-30 17:37     ` Bart Van Assche
2015-11-30 22:47       ` Martin K. Petersen
2015-11-20 21:34 ` [PATCH 2/2] Fix a memory leak in scsi_host_dev_release() Bart Van Assche
2015-11-26  3:40 ` [PATCH 0/2] Fix a scsi_host_dev_release() memory leak Martin K. Petersen
2015-11-26  7:35   ` Christoph Hellwig

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=1448369012.2877.28.camel@suse.de \
    --to=jthumshirn@suse.de \
    --cc=bart.vanassche@sandisk.com \
    --cc=hare@suse.de \
    --cc=hch@infradead.org \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=james.smart@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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;
as well as URLs for NNTP newsgroup(s).