mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
nvmet-fc: inline nvmet_fc_free_hostport
No need for this tiny helper with only one user, let's inline it. And since the hostport ref counter needs to stay in sync, it's not optional anymore to give back the reference. Signed-off-by: Daniel Wagner <wagi@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
aeaa0913a6
commit
88517565b5
|
|
@ -995,16 +995,6 @@ nvmet_fc_hostport_get(struct nvmet_fc_hostport *hostport)
|
|||
return kref_get_unless_zero(&hostport->ref);
|
||||
}
|
||||
|
||||
static void
|
||||
nvmet_fc_free_hostport(struct nvmet_fc_hostport *hostport)
|
||||
{
|
||||
/* if LLDD not implemented, leave as NULL */
|
||||
if (!hostport || !hostport->hosthandle)
|
||||
return;
|
||||
|
||||
nvmet_fc_hostport_put(hostport);
|
||||
}
|
||||
|
||||
static struct nvmet_fc_hostport *
|
||||
nvmet_fc_match_hostport(struct nvmet_fc_tgtport *tgtport, void *hosthandle)
|
||||
{
|
||||
|
|
@ -1184,7 +1174,7 @@ nvmet_fc_target_assoc_free(struct kref *ref)
|
|||
/* Send Disconnect now that all i/o has completed */
|
||||
nvmet_fc_xmt_disconnect_assoc(assoc);
|
||||
|
||||
nvmet_fc_free_hostport(assoc->hostport);
|
||||
nvmet_fc_hostport_put(assoc->hostport);
|
||||
spin_lock_irqsave(&tgtport->lock, flags);
|
||||
oldls = assoc->rcv_disconn;
|
||||
spin_unlock_irqrestore(&tgtport->lock, flags);
|
||||
|
|
@ -1449,11 +1439,6 @@ nvmet_fc_free_tgtport(struct kref *ref)
|
|||
struct nvmet_fc_tgtport *tgtport =
|
||||
container_of(ref, struct nvmet_fc_tgtport, ref);
|
||||
struct device *dev = tgtport->dev;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&nvmet_fc_tgtlock, flags);
|
||||
list_del(&tgtport->tgt_list);
|
||||
spin_unlock_irqrestore(&nvmet_fc_tgtlock, flags);
|
||||
|
||||
nvmet_fc_free_ls_iodlist(tgtport);
|
||||
|
||||
|
|
@ -1614,6 +1599,11 @@ int
|
|||
nvmet_fc_unregister_targetport(struct nvmet_fc_target_port *target_port)
|
||||
{
|
||||
struct nvmet_fc_tgtport *tgtport = targetport_to_tgtport(target_port);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&nvmet_fc_tgtlock, flags);
|
||||
list_del(&tgtport->tgt_list);
|
||||
spin_unlock_irqrestore(&nvmet_fc_tgtlock, flags);
|
||||
|
||||
nvmet_fc_portentry_unbind_tgt(tgtport);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user