Whamcloud - gitweb
LU-10391 lnet: switch to large lnet_processid for matching
[fs/lustre-release.git] / lnet / lnet / lib-me.c
index 3e0c940..8d7c9ee 100644 (file)
@@ -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)