X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Flnet%2Flib-me.c;h=8d7c9ee97f94b916569a93637317370f3798235e;hp=3e0c9401a069a99227f39bd331ab3a7a0d53d404;hb=db49fbf00d24edc8347006241f314fb0f82f1b63;hpb=0cf2b328fe1a417e3c4d5ff6216e0b86738d28bf diff --git a/lnet/lnet/lib-me.c b/lnet/lnet/lib-me.c index 3e0c940..8d7c9ee 100644 --- a/lnet/lnet/lib-me.c +++ b/lnet/lnet/lib-me.c @@ -27,7 +27,6 @@ */ /* * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. * * lnet/lnet/lib-me.c * @@ -67,7 +66,7 @@ */ struct lnet_me * LNetMEAttach(unsigned int portal, - struct lnet_process_id match_id, + struct lnet_processid *match_id, __u64 match_bits, __u64 ignore_bits, enum lnet_unlink unlink, enum lnet_ins_pos pos) { @@ -85,7 +84,7 @@ LNetMEAttach(unsigned int portal, if (mtable == NULL) /* can't match portal type */ return ERR_PTR(-EPERM); - me = kmem_cache_alloc(lnet_mes_cachep, GFP_NOFS | __GFP_ZERO); + me = kmem_cache_zalloc(lnet_mes_cachep, GFP_NOFS); if (me == NULL) { CDEBUG(D_MALLOC, "failed to allocate 'me'\n"); return ERR_PTR(-ENOMEM); @@ -95,7 +94,7 @@ LNetMEAttach(unsigned int portal, lnet_res_lock(mtable->mt_cpt); me->me_portal = portal; - me->me_match_id = match_id; + me->me_match_id = *match_id; me->me_match_bits = match_bits; me->me_ignore_bits = ignore_bits; me->me_unlink = unlink; @@ -119,47 +118,6 @@ LNetMEAttach(unsigned int portal, } EXPORT_SYMBOL(LNetMEAttach); -/** - * Unlink a match entry from its match list. - * - * This operation also releases any resources associated with the ME. If a - * memory descriptor is attached to the ME, then it will be unlinked as well - * and an unlink event will be generated. It is an error to use the ME handle - * after calling LNetMEUnlink(). - * - * \param meh A handle for the ME to be unlinked. - * - * \retval 0 On success. - * \retval -ENOENT If \a meh does not point to a valid ME. - * \see LNetMDUnlink() for the discussion on delivering unlink event. - */ -void -LNetMEUnlink(struct lnet_me *me) -{ - struct lnet_libmd *md; - struct lnet_event ev; - int cpt; - - LASSERT(the_lnet.ln_refcount > 0); - - cpt = me->me_cpt; - lnet_res_lock(cpt); - - md = me->me_md; - if (md != NULL) { - md->md_flags |= LNET_MD_FLAG_ABORTED; - if (md->md_eq != NULL && md->md_refcount == 0) { - lnet_build_unlink_event(md, &ev); - md->md_eq(&ev); - } - } - - lnet_me_unlink(me); - - lnet_res_unlock(cpt); -} -EXPORT_SYMBOL(LNetMEUnlink); - /* call with lnet_res_lock please */ void lnet_me_unlink(struct lnet_me *me)