Whamcloud - gitweb
LU-748 test: shorten the runtime of sanity subtest_220
[fs/lustre-release.git] / libcfs / libcfs / nidstrings.c
index 36009d4..9f75501 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -78,8 +78,8 @@ void libcfs_init_nidstrings (void)
 # define NIDSTR_LOCK(f)   cfs_spin_lock_irqsave(&libcfs_nidstring_lock, f)
 # define NIDSTR_UNLOCK(f) cfs_spin_unlock_irqrestore(&libcfs_nidstring_lock, f)
 #else
-# define NIDSTR_LOCK(f)   (f=0)                 /* avoid unused var warnings */
-# define NIDSTR_UNLOCK(f) (f=0)
+# define NIDSTR_LOCK(f)   (f=sizeof(f))  /* avoid set-but-unused warnings */
+# define NIDSTR_UNLOCK(f) (f=sizeof(f))
 #endif
 
 static char *
@@ -206,6 +206,13 @@ static struct netstrfns  libcfs_netstrfns[] = {
          /* .nf_str2addr  */  libcfs_num_str2addr,
          /* .nf_parse_addrlist*/  libcfs_num_parse,
          /* .nf_match_addr*/  libcfs_num_match},
+        {/* .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_match_addr*/  libcfs_num_match},
         /* placeholder for net0 alias.  It MUST BE THE LAST ENTRY */
         {/* .nf_type      */  -1},
 };
@@ -434,7 +441,7 @@ libcfs_nid2str(lnet_nid_t nid)
         int               nob;
 
         if (nid == LNET_NID_ANY)
-                return "LNET_NID_ANY";
+                return "<?>";
 
         nf = libcfs_lnd2netstrfns(lnd);
         str = libcfs_next_nidstring();
@@ -576,7 +583,7 @@ libcfs_str2anynid(lnet_nid_t *nidp, const char *str)
  *                       <number> '-' <number> '/' <number>
  * <net>             :== <netname> | <netname><number>
  * <netname>         :== "lo" | "tcp" | "o2ib" | "cib" | "openib" | "iib" |
- *                       "vib" | "ra" | "elan" | "gm" | "mx" | "ptl"
+ *                       "vib" | "ra" | "elan" | "mx" | "ptl"
  * \endverbatim
  */