The checks for a valid input values are mixed with the logic to insert aReviewed-by: Hannes Reinecke <hare@xxxxxxx>
newly allocated nport. Refactor the function so that first the checks
are done.
This allows to untangle the setup steps into a more linear form which
reduces the complexity of the functions.
Also start tracking lport when a lport is assigned to a nport. This
ensures, that the lport is not going away as long it is still referenced
by a nport.
Signed-off-by: Daniel Wagner <wagi@xxxxxxxxxx>
---
drivers/nvme/target/fcloop.c | 107 ++++++++++++++++++++++++++-----------------
1 file changed, 64 insertions(+), 43 deletions(-)