4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
30 * Copyright (c) 2011, 2012, Intel Corporation.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * libcfs/libcfs/nidstrings.c
38 * Author: Phil Schwan <phil@clusterfs.com>
41 #define DEBUG_SUBSYSTEM S_LNET
43 #include <linux/libcfs/libcfs.h>
44 #include <linux/lnet/lnet.h>
46 /* CAVEAT VENDITOR! Keep the canonical string representation of nets/nids
47 * consistent in all conversion functions. Some code fragments are copied
48 * around for the sake of clarity...
51 /* CAVEAT EMPTOR! Racey temporary buffer allocation!
52 * Choose the number of nidstrings to support the MAXIMUM expected number of
53 * concurrent users. If there are more, the returned string will be volatile.
54 * NB this number must allow for a process to be descheduled for a timeslice
55 * between getting its string and using it.
58 static char libcfs_nidstrings[LNET_NIDSTR_COUNT][LNET_NIDSTR_SIZE];
59 static int libcfs_nidstring_idx = 0;
61 static spinlock_t libcfs_nidstring_lock;
63 void libcfs_init_nidstrings (void)
65 spin_lock_init(&libcfs_nidstring_lock);
68 # define NIDSTR_LOCK(f) spin_lock_irqsave(&libcfs_nidstring_lock, f)
69 # define NIDSTR_UNLOCK(f) spin_unlock_irqrestore(&libcfs_nidstring_lock, f)
72 libcfs_next_nidstring (void)
79 str = libcfs_nidstrings[libcfs_nidstring_idx++];
80 if (libcfs_nidstring_idx ==
81 sizeof(libcfs_nidstrings)/sizeof(libcfs_nidstrings[0]))
82 libcfs_nidstring_idx = 0;
88 static int libcfs_lo_str2addr(const char *str, int nob, __u32 *addr);
89 static void libcfs_ip_addr2str(__u32 addr, char *str);
90 static int libcfs_ip_str2addr(const char *str, int nob, __u32 *addr);
91 static void libcfs_decnum_addr2str(__u32 addr, char *str);
92 static void libcfs_hexnum_addr2str(__u32 addr, char *str);
93 static int libcfs_num_str2addr(const char *str, int nob, __u32 *addr);
94 static int libcfs_num_parse(char *str, int len, struct list_head *list);
95 static int libcfs_num_match(__u32 addr, struct list_head *list);
101 void (*nf_addr2str)(__u32 addr, char *str);
102 int (*nf_str2addr)(const char *str, int nob, __u32 *addr);
103 int (*nf_parse_addrlist)(char *str, int len,
104 struct list_head *list);
105 int (*nf_match_addr)(__u32 addr, struct list_head *list);
108 static struct netstrfns libcfs_netstrfns[] = {
109 {/* .nf_type */ LOLND,
111 /* .nf_modname */ "klolnd",
112 /* .nf_addr2str */ libcfs_decnum_addr2str,
113 /* .nf_str2addr */ libcfs_lo_str2addr,
114 /* .nf_parse_addr*/ libcfs_num_parse,
115 /* .nf_match_addr*/ libcfs_num_match},
116 {/* .nf_type */ SOCKLND,
117 /* .nf_name */ "tcp",
118 /* .nf_modname */ "ksocklnd",
119 /* .nf_addr2str */ libcfs_ip_addr2str,
120 /* .nf_str2addr */ libcfs_ip_str2addr,
121 /* .nf_parse_addrlist*/ cfs_ip_addr_parse,
122 /* .nf_match_addr*/ cfs_ip_addr_match},
123 {/* .nf_type */ O2IBLND,
124 /* .nf_name */ "o2ib",
125 /* .nf_modname */ "ko2iblnd",
126 /* .nf_addr2str */ libcfs_ip_addr2str,
127 /* .nf_str2addr */ libcfs_ip_str2addr,
128 /* .nf_parse_addrlist*/ cfs_ip_addr_parse,
129 /* .nf_match_addr*/ cfs_ip_addr_match},
130 {/* .nf_type */ CIBLND,
131 /* .nf_name */ "cib",
132 /* .nf_modname */ "kciblnd",
133 /* .nf_addr2str */ libcfs_ip_addr2str,
134 /* .nf_str2addr */ libcfs_ip_str2addr,
135 /* .nf_parse_addrlist*/ cfs_ip_addr_parse,
136 /* .nf_match_addr*/ cfs_ip_addr_match},
137 {/* .nf_type */ OPENIBLND,
138 /* .nf_name */ "openib",
139 /* .nf_modname */ "kopeniblnd",
140 /* .nf_addr2str */ libcfs_ip_addr2str,
141 /* .nf_str2addr */ libcfs_ip_str2addr,
142 /* .nf_parse_addrlist*/ cfs_ip_addr_parse,
143 /* .nf_match_addr*/ cfs_ip_addr_match},
144 {/* .nf_type */ IIBLND,
145 /* .nf_name */ "iib",
146 /* .nf_modname */ "kiiblnd",
147 /* .nf_addr2str */ libcfs_ip_addr2str,
148 /* .nf_str2addr */ libcfs_ip_str2addr,
149 /* .nf_parse_addrlist*/ cfs_ip_addr_parse,
150 /* .nf_match_addr*/ cfs_ip_addr_match},
151 {/* .nf_type */ VIBLND,
152 /* .nf_name */ "vib",
153 /* .nf_modname */ "kviblnd",
154 /* .nf_addr2str */ libcfs_ip_addr2str,
155 /* .nf_str2addr */ libcfs_ip_str2addr,
156 /* .nf_parse_addrlist*/ cfs_ip_addr_parse,
157 /* .nf_match_addr*/ cfs_ip_addr_match},
158 {/* .nf_type */ RALND,
160 /* .nf_modname */ "kralnd",
161 /* .nf_addr2str */ libcfs_ip_addr2str,
162 /* .nf_str2addr */ libcfs_ip_str2addr,
163 /* .nf_parse_addrlist*/ cfs_ip_addr_parse,
164 /* .nf_match_addr*/ cfs_ip_addr_match},
165 {/* .nf_type */ QSWLND,
166 /* .nf_name */ "elan",
167 /* .nf_modname */ "kqswlnd",
168 /* .nf_addr2str */ libcfs_decnum_addr2str,
169 /* .nf_str2addr */ libcfs_num_str2addr,
170 /* .nf_parse_addrlist*/ libcfs_num_parse,
171 /* .nf_match_addr*/ libcfs_num_match},
172 {/* .nf_type */ GMLND,
174 /* .nf_modname */ "kgmlnd",
175 /* .nf_addr2str */ libcfs_hexnum_addr2str,
176 /* .nf_str2addr */ libcfs_num_str2addr,
177 /* .nf_parse_addrlist*/ libcfs_num_parse,
178 /* .nf_match_addr*/ libcfs_num_match},
179 {/* .nf_type */ MXLND,
181 /* .nf_modname */ "kmxlnd",
182 /* .nf_addr2str */ libcfs_ip_addr2str,
183 /* .nf_str2addr */ libcfs_ip_str2addr,
184 /* .nf_parse_addrlist*/ cfs_ip_addr_parse,
185 /* .nf_match_addr*/ cfs_ip_addr_match},
186 {/* .nf_type */ PTLLND,
187 /* .nf_name */ "ptl",
188 /* .nf_modname */ "kptllnd",
189 /* .nf_addr2str */ libcfs_decnum_addr2str,
190 /* .nf_str2addr */ libcfs_num_str2addr,
191 /* .nf_parse_addrlist*/ libcfs_num_parse,
192 /* .nf_match_addr*/ libcfs_num_match},
193 {/* .nf_type */ GNILND,
194 /* .nf_name */ "gni",
195 /* .nf_modname */ "kgnilnd",
196 /* .nf_addr2str */ libcfs_decnum_addr2str,
197 /* .nf_str2addr */ libcfs_num_str2addr,
198 /* .nf_parse_addrlist*/ libcfs_num_parse,
199 /* .nf_match_addr*/ libcfs_num_match},
200 /* placeholder for net0 alias. It MUST BE THE LAST ENTRY */
204 const int libcfs_nnetstrfns = sizeof(libcfs_netstrfns)/sizeof(libcfs_netstrfns[0]);
207 libcfs_lo_str2addr(const char *str, int nob, __u32 *addr)
214 libcfs_ip_addr2str(__u32 addr, char *str)
216 #if 0 /* never lookup */
218 snprintf(str, LNET_NIDSTR_SIZE, "%u.%u.%u.%u",
219 (addr >> 24) & 0xff, (addr >> 16) & 0xff,
220 (addr >> 8) & 0xff, addr & 0xff);
223 /* CAVEAT EMPTOR XscanfX
224 * I use "%n" at the end of a sscanf format to detect trailing junk. However
225 * sscanf may return immediately if it sees the terminating '0' in a string, so
226 * I initialise the %n variable to the expected length. If sscanf sets it;
227 * fine, if it doesn't, then the scan ended at the end of the string, which is
231 libcfs_ip_str2addr(const char *str, int nob, __u32 *addr)
237 int n = nob; /* XscanfX */
240 if (sscanf(str, "%u.%u.%u.%u%n", &a, &b, &c, &d, &n) >= 4 &&
242 (a & ~0xff) == 0 && (b & ~0xff) == 0 &&
243 (c & ~0xff) == 0 && (d & ~0xff) == 0) {
244 *addr = ((a<<24)|(b<<16)|(c<<8)|d);
252 libcfs_decnum_addr2str(__u32 addr, char *str)
254 snprintf(str, LNET_NIDSTR_SIZE, "%u", addr);
258 libcfs_hexnum_addr2str(__u32 addr, char *str)
260 snprintf(str, LNET_NIDSTR_SIZE, "0x%x", addr);
264 libcfs_num_str2addr(const char *str, int nob, __u32 *addr)
269 if (sscanf(str, "0x%x%n", addr, &n) >= 1 && n == nob)
273 if (sscanf(str, "0X%x%n", addr, &n) >= 1 && n == nob)
277 if (sscanf(str, "%u%n", addr, &n) >= 1 && n == nob)
284 libcfs_lnd2netstrfns(int lnd)
289 for (i = 0; i < libcfs_nnetstrfns; i++)
290 if (lnd == libcfs_netstrfns[i].nf_type)
291 return &libcfs_netstrfns[i];
297 libcfs_namenum2netstrfns(const char *name)
299 struct netstrfns *nf;
302 for (i = 0; i < libcfs_nnetstrfns; i++) {
303 nf = &libcfs_netstrfns[i];
304 if (nf->nf_type >= 0 &&
305 !strncmp(name, nf->nf_name, strlen(nf->nf_name)))
312 libcfs_name2netstrfns(const char *name)
316 for (i = 0; i < libcfs_nnetstrfns; i++)
317 if (libcfs_netstrfns[i].nf_type >= 0 &&
318 !strcmp(libcfs_netstrfns[i].nf_name, name))
319 return &libcfs_netstrfns[i];
325 libcfs_isknown_lnd(int type)
327 return libcfs_lnd2netstrfns(type) != NULL;
331 libcfs_lnd2modname(int lnd)
333 struct netstrfns *nf = libcfs_lnd2netstrfns(lnd);
335 return (nf == NULL) ? NULL : nf->nf_modname;
339 libcfs_lnd2str(int lnd)
342 struct netstrfns *nf = libcfs_lnd2netstrfns(lnd);
347 str = libcfs_next_nidstring();
348 snprintf(str, LNET_NIDSTR_SIZE, "?%u?", lnd);
353 libcfs_str2lnd(const char *str)
355 struct netstrfns *nf = libcfs_name2netstrfns(str);
364 libcfs_net2str(__u32 net)
366 int lnd = LNET_NETTYP(net);
367 int num = LNET_NETNUM(net);
368 struct netstrfns *nf = libcfs_lnd2netstrfns(lnd);
369 char *str = libcfs_next_nidstring();
372 snprintf(str, LNET_NIDSTR_SIZE, "<%u:%u>", lnd, num);
374 snprintf(str, LNET_NIDSTR_SIZE, "%s", nf->nf_name);
376 snprintf(str, LNET_NIDSTR_SIZE, "%s%u", nf->nf_name, num);
382 libcfs_nid2str(lnet_nid_t nid)
384 __u32 addr = LNET_NIDADDR(nid);
385 __u32 net = LNET_NIDNET(nid);
386 int lnd = LNET_NETTYP(net);
387 int nnum = LNET_NETNUM(net);
388 struct netstrfns *nf;
392 if (nid == LNET_NID_ANY)
395 nf = libcfs_lnd2netstrfns(lnd);
396 str = libcfs_next_nidstring();
399 snprintf(str, LNET_NIDSTR_SIZE, "%x@<%u:%u>", addr, lnd, nnum);
401 nf->nf_addr2str(addr, str);
404 snprintf(str + nob, LNET_NIDSTR_SIZE - nob, "@%s",
407 snprintf(str + nob, LNET_NIDSTR_SIZE - nob, "@%s%u",
414 static struct netstrfns *
415 libcfs_str2net_internal(const char *str, __u32 *net)
417 struct netstrfns *uninitialized_var(nf);
422 for (i = 0; i < libcfs_nnetstrfns; i++) {
423 nf = &libcfs_netstrfns[i];
424 if (nf->nf_type >= 0 &&
425 !strncmp(str, nf->nf_name, strlen(nf->nf_name)))
429 if (i == libcfs_nnetstrfns)
432 nob = strlen(nf->nf_name);
434 if (strlen(str) == (unsigned int)nob) {
437 if (nf->nf_type == LOLND) /* net number not allowed */
442 if (sscanf(str, "%u%n", &netnum, &i) < 1 ||
443 i != (int)strlen(str))
447 *net = LNET_MKNET(nf->nf_type, netnum);
452 libcfs_str2net(const char *str)
456 if (libcfs_str2net_internal(str, &net) != NULL)
459 return LNET_NIDNET(LNET_NID_ANY);
463 libcfs_str2nid(const char *str)
465 const char *sep = strchr(str, '@');
466 struct netstrfns *nf;
471 nf = libcfs_str2net_internal(sep + 1, &net);
475 sep = str + strlen(str);
476 net = LNET_MKNET(SOCKLND, 0);
477 nf = libcfs_lnd2netstrfns(SOCKLND);
478 LASSERT (nf != NULL);
481 if (!nf->nf_str2addr(str, (int)(sep - str), &addr))
484 return LNET_MKNID(net, addr);
488 libcfs_id2str(lnet_process_id_t id)
490 char *str = libcfs_next_nidstring();
492 if (id.pid == LNET_PID_ANY) {
493 snprintf(str, LNET_NIDSTR_SIZE,
494 "LNET_PID_ANY-%s", libcfs_nid2str(id.nid));
498 snprintf(str, LNET_NIDSTR_SIZE, "%s%u-%s",
499 ((id.pid & LNET_PID_USERFLAG) != 0) ? "U" : "",
500 (id.pid & ~LNET_PID_USERFLAG), libcfs_nid2str(id.nid));
505 libcfs_str2anynid(lnet_nid_t *nidp, const char *str)
507 if (!strcmp(str, "*")) {
508 *nidp = LNET_NID_ANY;
512 *nidp = libcfs_str2nid(str);
513 return *nidp != LNET_NID_ANY;
517 * Nid range list syntax.
520 * <nidlist> :== <nidrange> [ ' ' <nidrange> ]
521 * <nidrange> :== <addrrange> '@' <net>
522 * <addrrange> :== '*' |
525 * <ipaddr_range> :== <cfs_expr_list>.<cfs_expr_list>.<cfs_expr_list>.
527 * <cfs_expr_list> :== <number> |
529 * <expr_list> :== '[' <range_expr> [ ',' <range_expr>] ']'
530 * <range_expr> :== <number> |
531 * <number> '-' <number> |
532 * <number> '-' <number> '/' <number>
533 * <net> :== <netname> | <netname><number>
534 * <netname> :== "lo" | "tcp" | "o2ib" | "cib" | "openib" | "iib" |
535 * "vib" | "ra" | "elan" | "mx" | "ptl"
540 * Structure to represent \<nidrange\> token of the syntax.
542 * One of this is created for each \<net\> parsed.
546 * Link to list of this structures which is built on nid range
549 struct list_head nr_link;
551 * List head for addrrange::ar_link.
553 struct list_head nr_addrranges;
555 * Flag indicating that *@<net> is found.
559 * Pointer to corresponding element of libcfs_netstrfns.
561 struct netstrfns *nr_netstrfns;
563 * Number of network. E.g. 5 if \<net\> is "elan5".
569 * Structure to represent \<addrrange\> token of the syntax.
573 * Link to nidrange::nr_addrranges.
575 struct list_head ar_link;
577 * List head for cfs_expr_list::el_list.
579 struct list_head ar_numaddr_ranges;
583 * Nf_parse_addrlist method for networks using numeric addresses.
585 * Examples of such networks are gm and elan.
587 * \retval 0 if \a str parsed to numeric address
588 * \retval errno otherwise
591 libcfs_num_parse(char *str, int len, struct list_head *list)
593 struct cfs_expr_list *el;
596 rc = cfs_expr_list_parse(str, len, 0, MAX_NUMERIC_VALUE, &el);
598 list_add_tail(&el->el_link, list);
604 * Parses \<addrrange\> token on the syntax.
606 * Allocates struct addrrange and links to \a nidrange via
607 * (nidrange::nr_addrranges)
609 * \retval 1 if \a src parses to '*' | \<ipaddr_range\> | \<cfs_expr_list\>
610 * \retval 0 otherwise
613 parse_addrange(const struct cfs_lstr *src, struct nidrange *nidrange)
615 struct addrrange *addrrange;
617 if (src->ls_len == 1 && src->ls_str[0] == '*') {
618 nidrange->nr_all = 1;
622 LIBCFS_ALLOC(addrrange, sizeof(struct addrrange));
623 if (addrrange == NULL)
625 list_add_tail(&addrrange->ar_link, &nidrange->nr_addrranges);
626 INIT_LIST_HEAD(&addrrange->ar_numaddr_ranges);
628 return nidrange->nr_netstrfns->nf_parse_addrlist(src->ls_str,
630 &addrrange->ar_numaddr_ranges);
634 * Finds or creates struct nidrange.
636 * Checks if \a src is a valid network name, looks for corresponding
637 * nidrange on the ist of nidranges (\a nidlist), creates new struct
638 * nidrange if it is not found.
640 * \retval pointer to struct nidrange matching network specified via \a src
641 * \retval NULL if \a src does not match any network
643 static struct nidrange *
644 add_nidrange(const struct cfs_lstr *src,
645 struct list_head *nidlist)
647 struct netstrfns *nf;
652 if (src->ls_len >= LNET_NIDSTR_SIZE)
655 nf = libcfs_namenum2netstrfns(src->ls_str);
658 endlen = src->ls_len - strlen(nf->nf_name);
660 /* network name only, e.g. "elan" or "tcp" */
663 /* e.g. "elan25" or "tcp23", refuse to parse if
664 * network name is not appended with decimal or
665 * hexadecimal number */
666 if (!cfs_str2num_check(src->ls_str + strlen(nf->nf_name),
667 endlen, &netnum, 0, MAX_NUMERIC_VALUE))
671 list_for_each_entry(nr, nidlist, nr_link) {
672 if (nr->nr_netstrfns != nf)
674 if (nr->nr_netnum != netnum)
679 LIBCFS_ALLOC(nr, sizeof(struct nidrange));
682 list_add_tail(&nr->nr_link, nidlist);
683 INIT_LIST_HEAD(&nr->nr_addrranges);
684 nr->nr_netstrfns = nf;
686 nr->nr_netnum = netnum;
692 * Parses \<nidrange\> token of the syntax.
694 * \retval 1 if \a src parses to \<addrrange\> '@' \<net\>
695 * \retval 0 otherwise
698 parse_nidrange(struct cfs_lstr *src, struct list_head *nidlist)
700 struct cfs_lstr addrrange;
706 if (cfs_gettok(src, '@', &addrrange) == 0)
709 if (cfs_gettok(src, '@', &net) == 0 || src->ls_str != NULL)
712 nr = add_nidrange(&net, nidlist);
716 if (parse_addrange(&addrrange, nr) != 0)
721 CWARN("can't parse nidrange: \"%.*s\"\n", tmp.ls_len, tmp.ls_str);
726 * Frees addrrange structures of \a list.
728 * For each struct addrrange structure found on \a list it frees
729 * cfs_expr_list list attached to it and frees the addrrange itself.
734 free_addrranges(struct list_head *list)
736 while (!list_empty(list)) {
737 struct addrrange *ar;
739 ar = list_entry(list->next, struct addrrange, ar_link);
741 cfs_expr_list_free_list(&ar->ar_numaddr_ranges);
742 list_del(&ar->ar_link);
743 LIBCFS_FREE(ar, sizeof(struct addrrange));
748 * Frees nidrange strutures of \a list.
750 * For each struct nidrange structure found on \a list it frees
751 * addrrange list attached to it and frees the nidrange itself.
756 cfs_free_nidlist(struct list_head *list)
758 struct list_head *pos, *next;
761 list_for_each_safe(pos, next, list) {
762 nr = list_entry(pos, struct nidrange, nr_link);
763 free_addrranges(&nr->nr_addrranges);
765 LIBCFS_FREE(nr, sizeof(struct nidrange));
770 * Parses nid range list.
772 * Parses with rigorous syntax and overflow checking \a str into
773 * \<nidrange\> [ ' ' \<nidrange\> ], compiles \a str into set of
774 * structures and links that structure to \a nidlist. The resulting
775 * list can be used to match a NID againts set of NIDS defined by \a
779 * \retval 1 on success
780 * \retval 0 otherwise
783 cfs_parse_nidlist(char *str, int len, struct list_head *nidlist)
792 INIT_LIST_HEAD(nidlist);
794 rc = cfs_gettok(&src, ' ', &res);
796 cfs_free_nidlist(nidlist);
799 rc = parse_nidrange(&res, nidlist);
801 cfs_free_nidlist(nidlist);
809 * Nf_match_addr method for networks using numeric addresses
812 * \retval 0 otherwise
815 libcfs_num_match(__u32 addr, struct list_head *numaddr)
817 struct cfs_expr_list *el;
819 LASSERT(!list_empty(numaddr));
820 el = list_entry(numaddr->next, struct cfs_expr_list, el_link);
822 return cfs_expr_list_match(addr, el);
826 * Matches a nid (\a nid) against the compiled list of nidranges (\a nidlist).
828 * \see cfs_parse_nidlist()
831 * \retval 0 otherwises
833 int cfs_match_nid(lnet_nid_t nid, struct list_head *nidlist)
836 struct addrrange *ar;
839 list_for_each_entry(nr, nidlist, nr_link) {
840 if (nr->nr_netstrfns->nf_type != LNET_NETTYP(LNET_NIDNET(nid)))
842 if (nr->nr_netnum != LNET_NETNUM(LNET_NIDNET(nid)))
846 list_for_each_entry(ar, &nr->nr_addrranges, ar_link)
847 if (nr->nr_netstrfns->nf_match_addr(LNET_NIDADDR(nid),
848 &ar->ar_numaddr_ranges))
855 EXPORT_SYMBOL(libcfs_isknown_lnd);
856 EXPORT_SYMBOL(libcfs_lnd2modname);
857 EXPORT_SYMBOL(libcfs_lnd2str);
858 EXPORT_SYMBOL(libcfs_str2lnd);
859 EXPORT_SYMBOL(libcfs_net2str);
860 EXPORT_SYMBOL(libcfs_nid2str);
861 EXPORT_SYMBOL(libcfs_str2net);
862 EXPORT_SYMBOL(libcfs_str2nid);
863 EXPORT_SYMBOL(libcfs_id2str);
864 EXPORT_SYMBOL(libcfs_str2anynid);
865 EXPORT_SYMBOL(cfs_free_nidlist);
866 EXPORT_SYMBOL(cfs_parse_nidlist);
867 EXPORT_SYMBOL(cfs_match_nid);