[lustre-devel] [PATCH 339/622] lnet: simplify lnet_handle_local_failure()

James Simmons jsimmons at infradead.org
Thu Feb 27 13:13:27 PST 2020


From: Amir Shehata <ashehata at whamcloud.com>

Pass the struct lnet_ni to lnet_handle_local_failure() instead of the
message structure, since nothing else from the message is being
used. This also makes symmetrical with lnet_handle_remote_failure()

WC-bug-id: https://jira.whamcloud.com/browse/LU-11300
Lustre-commit: f8c7dd6f5374 ("LU-11300 lnet: simplify lnet_handle_local_failure()")
Signed-off-by: Amir Shehata <ashehata at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33452
Reviewed-by: Olaf Weber <olaf.weber at hpe.com>
Reviewed-by: Sebastien Buisson <sbuisson at ddn.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 net/lnet/lnet/lib-msg.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/net/lnet/lnet/lib-msg.c b/net/lnet/lnet/lib-msg.c
index e4253de..23c3bf4 100644
--- a/net/lnet/lnet/lib-msg.c
+++ b/net/lnet/lnet/lib-msg.c
@@ -461,12 +461,8 @@
 }
 
 static void
-lnet_handle_local_failure(struct lnet_msg *msg)
+lnet_handle_local_failure(struct lnet_ni *local_ni)
 {
-	struct lnet_ni *local_ni;
-
-	local_ni = msg->msg_txni;
-
 	/* the lnet_net_lock(0) is used to protect the addref on the ni
 	 * and the recovery queue.
 	 */
@@ -652,7 +648,7 @@
 	case LNET_MSG_STATUS_LOCAL_ABORTED:
 	case LNET_MSG_STATUS_LOCAL_NO_ROUTE:
 	case LNET_MSG_STATUS_LOCAL_TIMEOUT:
-		lnet_handle_local_failure(msg);
+		lnet_handle_local_failure(msg->msg_txni);
 		/* add to the re-send queue */
 		goto resend;
 
@@ -660,7 +656,7 @@
 	 * finalize the message
 	 */
 	case LNET_MSG_STATUS_LOCAL_ERROR:
-		lnet_handle_local_failure(msg);
+		lnet_handle_local_failure(msg->msg_txni);
 		return -1;
 
 	/* TODO: since the remote dropped the message we can
-- 
1.8.3.1



More information about the lustre-devel mailing list