]> www.infradead.org Git - nvme.git/commit
nvmet-fc: take tgtport reference only once
authorDaniel Wagner <wagi@kernel.org>
Tue, 8 Apr 2025 15:29:09 +0000 (17:29 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 9 Apr 2025 11:03:56 +0000 (13:03 +0200)
commitb0b26ad0e1943de25ce82a7e5af3574f31b1cf99
tree6e10b5e104226a5a422487cb90fcc1b61b22f3c0
parent1a909565733edb1d46c8e9692a1ee278912b5a77
nvmet-fc: take tgtport reference only once

The reference counting code can be simplified. Instead taking a tgtport
refrerence at the beginning of nvmet_fc_alloc_hostport and put it back
if not a new hostport object is allocated, only take it when a new
hostport object is allocated.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fc.c