• Chaitanya Kulkarni's avatar
    nvme-fabrics: open code __nvmf_host_find() · 959ffef1
    Chaitanya Kulkarni authored
    There is no point in maintaining a separate funciton __nvmf_host_find()
    that has only one caller nvmf_host_add() especially when caller and
    callee both are small enough to merge.
    
    Due to this we are actually repeating the error handling code in both
    callee and caller for no reason that can be avoided, but instead we have
    to read both function to establish the correctness along with additional
    lockdep warning check due to involved locking.
    
    Just open code __nvmf_host_find() in nvme_host_alloc() with appropriate
    comment that removes repeated error checks in the callee/caller and
    lockdep check that is needed for the nvmf_hosts_mutex involvement,
    diffstats :-
    
     drivers/nvme/host/fabrics.c | 75 +++++++++++++------------------------
     1 file changed, 27 insertions(+), 48 deletions(-)
    Signed-off-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
    Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarMax Gurtovoy <mgurtovoy@nvidia.com>
    Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
    959ffef1
fabrics.c 36.6 KB