X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Flnet%2Flib-me.c;h=d4f325d9cba2602e36e832933c7b5d58072b5c96;hp=72d451435c04380baf772eaae683dc1f9cb7276d;hb=c7bff5640caff778d4cfca229672a2cc67b350d6;hpb=790ac5c12fa977d8663317bb9a1de41bb6e2e044 diff --git a/lnet/lnet/lib-me.c b/lnet/lnet/lib-me.c index 72d4514..d4f325d 100644 --- a/lnet/lnet/lib-me.c +++ b/lnet/lnet/lib-me.c @@ -96,7 +96,7 @@ LNetMEAttach(unsigned int portal, if (me == NULL) return -ENOMEM; - LNET_LOCK(); + lnet_res_lock(); me->me_portal = portal; me->me_match_id = match_id; @@ -116,7 +116,7 @@ LNetMEAttach(unsigned int portal, lnet_me2handle(handle, me); - LNET_UNLOCK(); + lnet_res_unlock(); return 0; } @@ -156,23 +156,23 @@ LNetMEInsert(lnet_handle_me_t current_meh, if (new_me == NULL) return -ENOMEM; - LNET_LOCK(); + lnet_res_lock(); - current_me = lnet_handle2me(¤t_meh); - if (current_me == NULL) { + current_me = lnet_handle2me(¤t_meh); + if (current_me == NULL) { lnet_me_free_locked(new_me); - LNET_UNLOCK(); - return -ENOENT; - } + lnet_res_unlock(); + return -ENOENT; + } - LASSERT (current_me->me_portal < the_lnet.ln_nportals); + LASSERT(current_me->me_portal < the_lnet.ln_nportals); ptl = the_lnet.ln_portals[current_me->me_portal]; if (lnet_ptl_is_unique(ptl)) { /* nosense to insertion on unique portal */ lnet_me_free_locked(new_me); - LNET_UNLOCK(); + lnet_res_unlock(); return -EPERM; } @@ -192,9 +192,9 @@ LNetMEInsert(lnet_handle_me_t current_meh, lnet_me2handle(handle, new_me); - LNET_UNLOCK(); + lnet_res_unlock(); - return 0; + return 0; } /** @@ -221,11 +221,11 @@ LNetMEUnlink(lnet_handle_me_t meh) LASSERT (the_lnet.ln_init); LASSERT (the_lnet.ln_refcount > 0); - LNET_LOCK(); + lnet_res_lock(); me = lnet_handle2me(&meh); if (me == NULL) { - LNET_UNLOCK(); + lnet_res_unlock(); return -ENOENT; } @@ -239,11 +239,11 @@ LNetMEUnlink(lnet_handle_me_t meh) lnet_me_unlink(me); - LNET_UNLOCK(); + lnet_res_unlock(); return 0; } -/* call with LNET_LOCK please */ +/* call with lnet_res_lock please */ void lnet_me_unlink(lnet_me_t *me) {