[lustre-devel] [PATCH 19/34] lnet: simplify lnet_islocalnet()

Doug Oucharek doucharek at cray.com
Tue Sep 11 21:02:19 PDT 2018


Reviewed-by: Doug Oucharek <dougso at me.com>

Doug

On 9/6/18, 5:54 PM, "NeilBrown" <neilb at suse.com> wrote:

    Having lnet_get_net_locked() makes this (a little) simpler.
    
    This is part of
        8cbb8cd3e771e7f7e0f99cafc19fad32770dc015
           LU-7734 lnet: Multi-Rail local NI split
    
    Signed-off-by: NeilBrown <neilb at suse.com>
    ---
     drivers/staging/lustre/lnet/lnet/api-ni.c |   14 +++++---------
     1 file changed, 5 insertions(+), 9 deletions(-)
    
    diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
    index 618fdf8141f0..546d5101360f 100644
    --- a/drivers/staging/lustre/lnet/lnet/api-ni.c
    +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
    @@ -764,20 +764,16 @@ lnet_cpt_of_nid(lnet_nid_t nid, struct lnet_ni *ni)
     EXPORT_SYMBOL(lnet_cpt_of_nid);
     
     int
    -lnet_islocalnet(__u32 net)
    +lnet_islocalnet(__u32 net_id)
     {
    -	struct lnet_ni *ni;
    -	int cpt;
    +	struct lnet_net *net;
    +	int		cpt;
     
     	cpt = lnet_net_lock_current();
    -
    -	ni = lnet_net2ni_locked(net, cpt);
    -	if (ni)
    -		lnet_ni_decref_locked(ni, cpt);
    -
    +	net = lnet_get_net_locked(net_id);
     	lnet_net_unlock(cpt);
     
    -	return !!ni;
    +	return !!net;
     }
     
     bool
    
    
    



More information about the lustre-devel mailing list