Whamcloud - gitweb
LU-10391 obdclass: change class_match_nid to take lnet_nid 90/50090/8
authorMr NeilBrown <neilb@suse.de>
Tue, 10 May 2022 04:09:08 +0000 (14:09 +1000)
committerOleg Drokin <green@whamcloud.com>
Tue, 11 Apr 2023 20:03:13 +0000 (20:03 +0000)
class_match_nid now takes struct lnet_nid rather than lnet_nid_t.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I09c178a6671ee3e603d261579537ff10881d8124
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50090
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd_class.h
lustre/obdclass/obd_config.c
lustre/target/tgt_mount.c

index add1d7c..f3c3a1d 100644 (file)
@@ -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,
index 779354c..795a8de 100644 (file)
@@ -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;
index 5ad7670..9e99b94 100644 (file)
@@ -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,