*/
/*
* This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
*
* lnet/lnet/lib-me.c
*
*/
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)
{
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);
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;
}
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)