From bd5e458cc5fc441dbfb68b62e2a92802302b3b19 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Wed, 6 Nov 2019 17:13:00 +1100 Subject: [PATCH] LU-12678 lnet: discard LNetMEInsert This function is unused and has never been used. It is not used by cray-dvs - the other user of LNet. So discard it. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: I35a012c390ae1a7ae9d601f12cf5da1b56d4eb6d Reviewed-on: https://review.whamcloud.com/36858 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Serguei Smirnov Reviewed-by: Amir Shehata Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lnet/include/lnet/api.h | 10 +----- lnet/lnet/lib-me.c | 87 ++----------------------------------------------- 2 files changed, 3 insertions(+), 94 deletions(-) diff --git a/lnet/include/lnet/api.h b/lnet/include/lnet/api.h index 1ce4a00..679da9e 100644 --- a/lnet/include/lnet/api.h +++ b/lnet/include/lnet/api.h @@ -93,7 +93,7 @@ bool LNetIsPeerLocal(lnet_nid_t nid); * and a set of match criteria. The match criteria can be used to reject * incoming requests based on process ID or the match bits provided in the * request. MEs can be dynamically inserted into a match list by LNetMEAttach() - * and LNetMEInsert(), and removed from its list by LNetMEUnlink(). + * and removed from its list by LNetMEUnlink(). * @{ */ int LNetMEAttach(unsigned int portal, struct lnet_process_id match_id_in, @@ -103,14 +103,6 @@ int LNetMEAttach(unsigned int portal, enum lnet_ins_pos pos_in, struct lnet_handle_me *handle_out); -int LNetMEInsert(struct lnet_handle_me current_in, - struct lnet_process_id match_id_in, - __u64 match_bits_in, - __u64 ignore_bits_in, - enum lnet_unlink unlink_in, - enum lnet_ins_pos position_in, - struct lnet_handle_me *handle_out); - int LNetMEUnlink(struct lnet_handle_me current_in); /** @} lnet_me */ diff --git a/lnet/lnet/lib-me.c b/lnet/lnet/lib-me.c index 1a1d9b1..578e353 100644 --- a/lnet/lnet/lib-me.c +++ b/lnet/lnet/lib-me.c @@ -61,8 +61,8 @@ * appended to the match list. Allowed constants: LNET_INS_BEFORE, * LNET_INS_AFTER. * \param handle On successful returns, a handle to the newly created ME - * object is saved here. This handle can be used later in LNetMEInsert(), - * LNetMEUnlink(), or LNetMDAttach() functions. + * object is saved here. This handle can be used later in LNetMEUnlink(), + * or LNetMDAttach() functions. * * \retval 0 On success. * \retval -EINVAL If \a portal is invalid. @@ -123,89 +123,6 @@ LNetMEAttach(unsigned int portal, EXPORT_SYMBOL(LNetMEAttach); /** - * Create and a match entry and insert it before or after the ME pointed to by - * \a current_meh. The new ME is empty, i.e. not associated with a memory - * descriptor. LNetMDAttach() can be used to attach a MD to an empty ME. - * - * This function is identical to LNetMEAttach() except for the position - * where the new ME is inserted. - * - * \param current_meh A handle for a ME. The new ME will be inserted - * immediately before or immediately after this ME. - * \param match_id,match_bits,ignore_bits,unlink,pos,handle See the discussion - * for LNetMEAttach(). - * - * \retval 0 On success. - * \retval -ENOMEM If new ME object cannot be allocated. - * \retval -ENOENT If \a current_meh does not point to a valid match entry. - */ -int -LNetMEInsert(struct lnet_handle_me current_meh, - struct lnet_process_id match_id, - __u64 match_bits, __u64 ignore_bits, - enum lnet_unlink unlink, enum lnet_ins_pos pos, - struct lnet_handle_me *handle) -{ - struct lnet_me *current_me; - struct lnet_me *new_me; - struct lnet_portal *ptl; - int cpt; - - LASSERT(the_lnet.ln_refcount > 0); - - if (pos == LNET_INS_LOCAL) - return -EPERM; - - new_me = lnet_me_alloc(); - if (new_me == NULL) - return -ENOMEM; - - cpt = lnet_cpt_of_cookie(current_meh.cookie); - - lnet_res_lock(cpt); - - current_me = lnet_handle2me(¤t_meh); - if (current_me == NULL) { - lnet_me_free(new_me); - - lnet_res_unlock(cpt); - return -ENOENT; - } - - 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(new_me); - lnet_res_unlock(cpt); - return -EPERM; - } - - new_me->me_pos = current_me->me_pos; - new_me->me_portal = current_me->me_portal; - new_me->me_match_id = match_id; - new_me->me_match_bits = match_bits; - new_me->me_ignore_bits = ignore_bits; - new_me->me_unlink = unlink; - new_me->me_md = NULL; - - lnet_res_lh_initialize(the_lnet.ln_me_containers[cpt], &new_me->me_lh); - - if (pos == LNET_INS_AFTER) - list_add(&new_me->me_list, ¤t_me->me_list); - else - list_add_tail(&new_me->me_list, ¤t_me->me_list); - - lnet_me2handle(handle, new_me); - - lnet_res_unlock(cpt); - - return 0; -} -EXPORT_SYMBOL(LNetMEInsert); - -/** * Unlink a match entry from its match list. * * This operation also releases any resources associated with the ME. If a -- 1.8.3.1