# 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 *
/* .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},
};
int nob;
if (nid == LNET_NID_ANY)
- return "LNET_NID_ANY";
+ return "<?>";
nf = libcfs_lnd2netstrfns(lnd);
str = libcfs_next_nidstring();
return *nidp != LNET_NID_ANY;
}
-/* parse server details from name */
-int libcfs_str2server(char *name, int *type, __u32 *idx, char **endptr)
-{
- char *ptr;
- int i;
-
- ptr = strstr(name, "-MDT");
- if (ptr) {
- *type = SVTYPE_MDT;
- } else {
- ptr = strstr(name, "-OST");
- if (ptr)
- *type = SVTYPE_OST;
- else
- return -EINVAL;
- }
- ptr += 4;
-
- if (strncmp(ptr, "all", 3) == 0) {
- ptr += 3;
- *type |= SVTYPE_ALL;
- goto out;
- }
- if (*ptr == '*') {
- ptr++;
- *type |= SVTYPE_ALL;
- goto out;
- }
-
-#if __KERNEL__
- *idx = simple_strtoul(ptr, NULL, 16);
-#else
- *idx = strtoul(ptr, NULL, 16);
-#endif
- /* Require 4 hex digits */
- for (i = 0; i < 4; i++)
- if (!isxdigit(*ptr++))
- return -EINVAL;
-out:
- /* Only acceptable garbage at the end of name is [-.:,] etc. */
- if (isalnum(*ptr))
- return -EINVAL;
-
- if (endptr)
- *endptr = ptr;
- return 0;
-}
-
/**
* Nid range list syntax.
* \verbatim
EXPORT_SYMBOL(libcfs_str2nid);
EXPORT_SYMBOL(libcfs_id2str);
EXPORT_SYMBOL(libcfs_str2anynid);
-EXPORT_SYMBOL(libcfs_str2server);
EXPORT_SYMBOL(cfs_iswhite);
EXPORT_SYMBOL(cfs_free_nidlist);
EXPORT_SYMBOL(cfs_parse_nidlist);