From a6915dd9d82e2f2b47b9a103baae4391eedf94e2 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Tue, 10 May 2022 14:09:08 +1000 Subject: [PATCH] LU-10391 obdclass: change class_match_nid to take lnet_nid class_match_nid now takes struct lnet_nid rather than lnet_nid_t. Signed-off-by: Mr NeilBrown Change-Id: I09c178a6671ee3e603d261579537ff10881d8124 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50090 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: jsimmons Reviewed-by: Frank Sehr Reviewed-by: Oleg Drokin --- lustre/include/obd_class.h | 2 +- lustre/obdclass/obd_config.c | 8 ++++---- lustre/target/tgt_mount.c | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index add1d7c..f3c3a1d 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -179,7 +179,7 @@ int class_parse_nid4_quiet(char *buf, lnet_nid_t *nid4, char **endh); int class_parse_nid(char *buf, struct lnet_nid *nid, char **endh); int class_parse_nid_quiet(char *buf, struct lnet_nid *nid, char **endh); int class_parse_net(char *buf, u32 *net, char **endh); -int class_match_nid(char *buf, char *key, lnet_nid_t nid); +int class_match_nid(char *buf, char *key, struct lnet_nid *nid); int class_match_net(char *buf, char *key, u32 net); struct obd_device *class_incref(struct obd_device *obd, diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 779354c..795a8de 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -530,9 +530,9 @@ int class_parse_net(char *buf, __u32 *net, char **endh) * 0 param contains key and not match * -1 param does not contain key */ -int class_match_nid(char *buf, char *key, lnet_nid_t nid) +int class_match_nid(char *buf, char *key, struct lnet_nid *nid) { - lnet_nid_t tmp; + struct lnet_nid tmp; int rc = -1; while (class_find_param(buf, key, &buf) == 0) { @@ -540,8 +540,8 @@ int class_match_nid(char *buf, char *key, lnet_nid_t nid) * please restrict to the NIDs pertaining to * the specified NIDs */ - while (class_parse_nid4(buf, &tmp, &buf) == 0) { - if (tmp == nid) + while (class_parse_nid(buf, &tmp, &buf) == 0) { + if (nid_same(&tmp, nid)) return 1; } rc = 0; diff --git a/lustre/target/tgt_mount.c b/lustre/target/tgt_mount.c index 5ad7670..9e99b94 100644 --- a/lustre/target/tgt_mount.c +++ b/lustre/target/tgt_mount.c @@ -1178,8 +1178,7 @@ static int server_lsi2mti(struct lustre_sb_info *lsi, */ if ((lsi->lsi_lmd->lmd_flags & LMD_FLG_NO_PRIMNODE) != 0 && class_match_nid(lsi->lsi_lmd->lmd_params, - PARAM_FAILNODE, - lnet_nid_to_nid4(&id.nid)) < 1) + PARAM_FAILNODE, &id.nid) < 1) continue; if (!class_find_param(lsi->lsi_lmd->lmd_params, -- 1.8.3.1