Whamcloud - gitweb
LU-6210 lnet: Use C99 initializers for struct netstrfns 88/15088/13
authorJames Simmons <uja.ornl@yahoo.com>
Mon, 24 Aug 2015 14:59:29 +0000 (10:59 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 28 Aug 2015 02:07:28 +0000 (02:07 +0000)
Update struct netstrfns to use C99 initializers.

Remove old LND types from the netstrfns table, as they are
long obsolete and shouldn't be needed even for interop anymore.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Change-Id: I22cd2d770e0872de343af249d13bf0f56f8a4a7d
Reviewed-on: http://review.whamcloud.com/15088
Tested-by: Jenkins
Reviewed-by: frank zago <fzago@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lnet/lnet/nidstrings.c
lustre/tests/conf-sanity.sh

index 8f7808d..2995a72 100644 (file)
@@ -898,12 +898,6 @@ libcfs_decnum_addr2str(__u32 addr, char *str, size_t size)
        snprintf(str, size, "%u", addr);
 }
 
        snprintf(str, size, "%u", addr);
 }
 
-static void
-libcfs_hexnum_addr2str(__u32 addr, char *str, size_t size)
-{
-       snprintf(str, size, "0x%x", addr);
-}
-
 static int
 libcfs_num_str2addr(const char *str, int nob, __u32 *addr)
 {
 static int
 libcfs_num_str2addr(const char *str, int nob, __u32 *addr)
 {
@@ -975,147 +969,57 @@ libcfs_num_match(__u32 addr, struct list_head *numaddr)
        return cfs_expr_list_match(addr, el);
 }
 
        return cfs_expr_list_match(addr, el);
 }
 
-static struct netstrfns  libcfs_netstrfns[] = {
-       {/* .nf_type      */  LOLND,
-        /* .nf_name      */  "lo",
-        /* .nf_modname   */  "klolnd",
-        /* .nf_addr2str  */  libcfs_decnum_addr2str,
-        /* .nf_str2addr  */  libcfs_lo_str2addr,
-        /* .nf_parse_addr*/  libcfs_num_parse,
-        /* .nf_print_addrlist*/  libcfs_num_addr_range_print,
-        /* .nf_match_addr*/      libcfs_num_match,
-        /* .nf_is_contiguous */  cfs_num_is_contiguous,
-        /* .nf_min_max   */      cfs_num_min_max},
-       {/* .nf_type      */  SOCKLND,
-        /* .nf_name      */  "tcp",
-        /* .nf_modname   */  "ksocklnd",
-        /* .nf_addr2str  */  libcfs_ip_addr2str,
-        /* .nf_str2addr  */  libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
-       {/* .nf_type      */  O2IBLND,
-        /* .nf_name      */  "o2ib",
-        /* .nf_modname   */  "ko2iblnd",
-        /* .nf_addr2str  */  libcfs_ip_addr2str,
-        /* .nf_str2addr  */  libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
-       {/* .nf_type      */  CIBLND,
-        /* .nf_name      */  "cib",
-        /* .nf_modname   */  "kciblnd",
-        /* .nf_addr2str  */  libcfs_ip_addr2str,
-        /* .nf_str2addr  */  libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
-       {/* .nf_type      */  OPENIBLND,
-        /* .nf_name      */  "openib",
-        /* .nf_modname   */  "kopeniblnd",
-        /* .nf_addr2str  */  libcfs_ip_addr2str,
-        /* .nf_str2addr  */  libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
-       {/* .nf_type      */  IIBLND,
-        /* .nf_name      */  "iib",
-        /* .nf_modname   */  "kiiblnd",
-        /* .nf_addr2str  */  libcfs_ip_addr2str,
-        /* .nf_str2addr  */  libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
-       {/* .nf_type      */  VIBLND,
-        /* .nf_name      */  "vib",
-        /* .nf_modname   */  "kviblnd",
-        /* .nf_addr2str  */  libcfs_ip_addr2str,
-        /* .nf_str2addr  */  libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
-       {/* .nf_type      */  RALND,
-        /* .nf_name      */  "ra",
-        /* .nf_modname   */  "kralnd",
-        /* .nf_addr2str  */  libcfs_ip_addr2str,
-        /* .nf_str2addr  */  libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
-       {/* .nf_type      */      QSWLND,
-        /* .nf_name      */      "elan",
-        /* .nf_modname   */      "kqswlnd",
-        /* .nf_addr2str  */      libcfs_decnum_addr2str,
-        /* .nf_str2addr  */      libcfs_num_str2addr,
-        /* .nf_parse_addrlist*/  libcfs_num_parse,
-        /* .nf_print_addrlist*/  libcfs_num_addr_range_print,
-        /* .nf_match_addr*/      libcfs_num_match,
-        /* .nf_is_contiguous */  cfs_num_is_contiguous,
-        /* .nf_min_max   */      cfs_num_min_max},
-       {/* .nf_type      */      GMLND,
-        /* .nf_name      */      "gm",
-        /* .nf_modname   */      "kgmlnd",
-        /* .nf_addr2str  */      libcfs_hexnum_addr2str,
-        /* .nf_str2addr  */      libcfs_num_str2addr,
-        /* .nf_parse_addrlist*/  libcfs_num_parse,
-        /* .nf_print_addrlist*/  libcfs_num_addr_range_print,
-        /* .nf_match_addr*/      libcfs_num_match,
-        /* .nf_is_contiguous */  cfs_num_is_contiguous,
-        /* .nf_min_max   */      cfs_num_min_max},
-       {/* .nf_type      */      MXLND,
-        /* .nf_name      */      "mx",
-        /* .nf_modname   */      "kmxlnd",
-        /* .nf_addr2str  */      libcfs_ip_addr2str,
-        /* .nf_str2addr  */      libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
-       {/* .nf_type      */      PTLLND,
-        /* .nf_name      */      "ptl",
-        /* .nf_modname   */      "kptllnd",
-        /* .nf_addr2str  */      libcfs_decnum_addr2str,
-        /* .nf_str2addr  */      libcfs_num_str2addr,
-        /* .nf_parse_addrlist*/  libcfs_num_parse,
-        /* .nf_print_addrlist*/  libcfs_num_addr_range_print,
-        /* .nf_match_addr*/      libcfs_num_match,
-        /* .nf_is_contiguous */  cfs_num_is_contiguous,
-        /* .nf_min_max   */      cfs_num_min_max},
-       {/* .nf_type      */      GNILND,
-        /* .nf_name      */      "gni",
-        /* .nf_modname   */      "kgnilnd",
-        /* .nf_addr2str  */      libcfs_decnum_addr2str,
-        /* .nf_str2addr  */      libcfs_num_str2addr,
-        /* .nf_parse_addrlist*/  libcfs_num_parse,
-        /* .nf_print_addrlist*/  libcfs_num_addr_range_print,
-        /* .nf_match_addr*/      libcfs_num_match,
-        /* .nf_is_contiguous */  cfs_num_is_contiguous,
-        /* .nf_min_max   */      cfs_num_min_max},
-       {/* .nf_type      */      GNIIPLND,
-        /* .nf_name      */      "gip",
-        /* .nf_modname   */      "kgnilnd",
-        /* .nf_addr2str  */      libcfs_ip_addr2str,
-        /* .nf_str2addr  */      libcfs_ip_str2addr,
-        /* .nf_parse_addrlist*/  cfs_ip_addr_parse,
-        /* .nf_print_addrlist*/  libcfs_ip_addr_range_print,
-        /* .nf_match_addr*/      cfs_ip_addr_match,
-        /* .nf_is_contiguous */  cfs_ip_is_contiguous,
-        /* .nf_min_max   */      cfs_ip_min_max},
+static struct netstrfns libcfs_netstrfns[] = {
+       { .nf_type              = LOLND,
+         .nf_name              = "lo",
+         .nf_modname           = "klolnd",
+         .nf_addr2str          = libcfs_decnum_addr2str,
+         .nf_str2addr          = libcfs_lo_str2addr,
+         .nf_parse_addrlist    = libcfs_num_parse,
+         .nf_print_addrlist    = libcfs_num_addr_range_print,
+         .nf_match_addr        = libcfs_num_match,
+         .nf_is_contiguous     = cfs_num_is_contiguous,
+         .nf_min_max           = cfs_num_min_max },
+       { .nf_type              = SOCKLND,
+         .nf_name              = "tcp",
+         .nf_modname           = "ksocklnd",
+         .nf_addr2str          = libcfs_ip_addr2str,
+         .nf_str2addr          = libcfs_ip_str2addr,
+         .nf_parse_addrlist    = cfs_ip_addr_parse,
+         .nf_print_addrlist    = libcfs_ip_addr_range_print,
+         .nf_match_addr        = cfs_ip_addr_match,
+         .nf_is_contiguous     = cfs_ip_is_contiguous,
+         .nf_min_max           = cfs_ip_min_max },
+       { .nf_type              = O2IBLND,
+         .nf_name              = "o2ib",
+         .nf_modname           = "ko2iblnd",
+         .nf_addr2str          = libcfs_ip_addr2str,
+         .nf_str2addr          = libcfs_ip_str2addr,
+         .nf_parse_addrlist    = cfs_ip_addr_parse,
+         .nf_print_addrlist    = libcfs_ip_addr_range_print,
+         .nf_match_addr        = cfs_ip_addr_match,
+         .nf_is_contiguous     = cfs_ip_is_contiguous,
+         .nf_min_max           = cfs_ip_min_max },
+       { .nf_type              = GNILND,
+         .nf_name              = "gni",
+         .nf_modname           = "kgnilnd",
+         .nf_addr2str          = libcfs_decnum_addr2str,
+         .nf_str2addr          = libcfs_num_str2addr,
+         .nf_parse_addrlist    = libcfs_num_parse,
+         .nf_print_addrlist    = libcfs_num_addr_range_print,
+         .nf_match_addr        = libcfs_num_match,
+         .nf_is_contiguous     = cfs_num_is_contiguous,
+         .nf_min_max           = cfs_num_min_max },
+       { .nf_type              = GNIIPLND,
+         .nf_name              = "gip",
+         .nf_modname           = "kgnilnd",
+         .nf_addr2str          = libcfs_ip_addr2str,
+         .nf_str2addr          = libcfs_ip_str2addr,
+         .nf_parse_addrlist    = cfs_ip_addr_parse,
+         .nf_print_addrlist    = libcfs_ip_addr_range_print,
+         .nf_match_addr        = cfs_ip_addr_match,
+         .nf_is_contiguous     = cfs_ip_is_contiguous,
+         .nf_min_max           = cfs_ip_min_max },
 };
 
 static const size_t libcfs_nnetstrfns = ARRAY_SIZE(libcfs_netstrfns);
 };
 
 static const size_t libcfs_nnetstrfns = ARRAY_SIZE(libcfs_netstrfns);
index 23cd0da..893cbc2 100644 (file)
@@ -2918,7 +2918,7 @@ test_43() {
        #   root should be able to access root file after that
        #
        local NIDLIST=$($LCTL list_nids all | tr '\n' ' ')
        #   root should be able to access root file after that
        #
        local NIDLIST=$($LCTL list_nids all | tr '\n' ' ')
-       NIDLIST="2@elan $NIDLIST 192.168.0.[2,10]@tcp"
+       NIDLIST="2@gni $NIDLIST 192.168.0.[2,10]@tcp"
        NIDLIST=$(echo $NIDLIST | tr -s ' ' ' ')
        set_conf_param_and_check mds                                    \
                "$LCTL get_param -n mdt.$FSNAME-MDT0000.nosquash_nids"  \
        NIDLIST=$(echo $NIDLIST | tr -s ' ' ' ')
        set_conf_param_and_check mds                                    \
                "$LCTL get_param -n mdt.$FSNAME-MDT0000.nosquash_nids"  \