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.gnu.org/licenses/gpl-2.0.html
23 * Copyright (C) 2013, Trustees of Indiana University
25 * Copyright (c) 2014, Intel Corporation.
27 * Author: Joshua Walgenbach <jjw@iu.edu>
30 #define NODEMAP_LPROC_ID_LEN 16
31 #define NODEMAP_LPROC_FLAG_LEN 2
33 #include <lprocfs_status.h>
34 #include <lustre_net.h>
35 #include <lustre_export.h>
36 #include <obd_class.h>
37 #include <interval_tree.h>
38 #include "nodemap_internal.h"
40 /* Turn on proc debug interface to allow OSS and
41 * MDS nodes to configure nodemap independently of
42 * MGS (since the nodemap distribution is not written
44 #define NODEMAP_PROC_DEBUG 1
47 * Reads and prints the idmap for the given nodemap.
49 * \param m seq file in proc fs
53 static int nodemap_idmap_show(struct seq_file *m, void *data)
55 struct lu_nodemap *nodemap = m->private;
56 struct lu_idmap *idmap;
61 read_lock(&nodemap->nm_idmap_lock);
62 for (node = rb_first(&nodemap->nm_client_to_fs_uidmap); node;
63 node = rb_next(node)) {
67 idmap = rb_entry(node, struct lu_idmap, id_client_to_fs);
69 seq_printf(m, " { idtype: uid, client_id: %u, "
70 "fs_id: %u }", idmap->id_client,
73 for (node = rb_first(&nodemap->nm_client_to_fs_gidmap);
74 node; node = rb_next(node)) {
77 idmap = rb_entry(node, struct lu_idmap, id_client_to_fs);
79 seq_printf(m, " { idtype: gid, client_id: %u, "
80 "fs_id: %u }", idmap->id_client,
83 read_unlock(&nodemap->nm_idmap_lock);
91 * Attaches nodemap_idmap_show to proc file.
93 * \param inode inode of seq file in proc fs
94 * \param file seq file
97 static int nodemap_idmap_open(struct inode *inode, struct file *file)
99 struct lu_nodemap *nodemap = PDE_DATA(inode);
101 return single_open(file, nodemap_idmap_show, nodemap);
105 * Reads and prints the NID ranges for the given nodemap.
107 * \param m seq file in proc fs
111 static int nodemap_ranges_show(struct seq_file *m, void *data)
113 struct lu_nodemap *nodemap = m->private;
114 struct lu_nid_range *range;
115 struct interval_node_extent ext;
116 char start_nidstr[LNET_NIDSTR_SIZE];
117 char end_nidstr[LNET_NIDSTR_SIZE];
120 seq_printf(m, "[\n");
121 read_lock(&nm_range_tree_lock);
122 list_for_each_entry(range, &nodemap->nm_ranges, rn_list) {
124 seq_printf(m, ",\n");
126 ext = range->rn_node.in_extent;
127 libcfs_nid2str_r(ext.start, start_nidstr, sizeof(start_nidstr));
128 libcfs_nid2str_r(ext.end, end_nidstr, sizeof(end_nidstr));
129 seq_printf(m, " { id: %u, start_nid: %s, end_nid: %s }",
130 range->rn_id, start_nidstr, end_nidstr);
132 read_unlock(&nm_range_tree_lock);
134 seq_printf(m, "]\n");
140 * Connects nodemap_idmap_show to proc file.
142 * \param inode inode of seq file in proc fs
143 * \param file seq file
146 static int nodemap_ranges_open(struct inode *inode, struct file *file)
148 struct lu_nodemap *nodemap = PDE_DATA(inode);
150 return single_open(file, nodemap_ranges_show, nodemap);
154 * Hash callback, reads and prints the exports attached to this nodemap.
156 * \param hs nodemap member hash
158 * \param hnode current member in hash
159 * \param data seq_file to print to
162 static int nodemap_exports_show_cb(cfs_hash_t *hs, cfs_hash_bd_t *bd,
163 struct hlist_node *hnode, void *data)
165 struct seq_file *m = data;
166 struct obd_export *exp;
167 char nidstr[LNET_NIDSTR_SIZE] = "<unknown>";
169 exp = hlist_entry(hnode, struct obd_export,
170 exp_target_data.ted_nodemap_member);
171 if (exp->exp_connection != NULL)
172 libcfs_nid2str_r(exp->exp_connection->c_peer.nid,
173 nidstr, sizeof(nidstr));
175 seq_printf(m, " { nid: %s, uuid: %s },",
176 nidstr, exp->exp_client_uuid.uuid);
182 * Reads and prints the exports attached to the given nodemap via hash
185 * \param m seq file in proc fs
189 static int nodemap_exports_show(struct seq_file *m, void *data)
191 struct lu_nodemap *nodemap = m->private;
193 seq_printf(m, "[\n");
195 cfs_hash_for_each(nodemap->nm_member_hash, nodemap_exports_show_cb, m);
198 seq_printf(m, "]\n");
204 * Attaches nodemap_idmap_show to proc file.
206 * \param inode inode of seq file in proc fs
207 * \param file seq file
210 static int nodemap_exports_open(struct inode *inode, struct file *file)
212 struct lu_nodemap *nodemap = PDE_DATA(inode);
214 return single_open(file, nodemap_exports_show, nodemap);
218 * Reads and prints the active flag for the given nodemap.
220 * \param m seq file in proc fs
224 static int nodemap_active_seq_show(struct seq_file *m, void *data)
226 return seq_printf(m, "%u\n", (unsigned int)nodemap_active);
230 * Activate/deactivate nodemap.
232 * \param[in] file proc file
233 * \param[in] buffer string, "1" or "0" to activate/deactivate nodemap
234 * \param[in] count \a buffer length
235 * \param[in] off unused
236 * \retval \a count on success
237 * \retval negative number on error
240 nodemap_active_seq_write(struct file *file, const char __user *buffer,
241 size_t count, loff_t *off)
243 char active_string[NODEMAP_LPROC_FLAG_LEN + 1];
244 long unsigned int active;
250 if (count >= sizeof(active_string))
253 if (copy_from_user(active_string, buffer, count))
256 active_string[count] = '\0';
257 rc = kstrtoul(active_string, 10, &active);
261 nodemap_active = active;
265 LPROC_SEQ_FOPS(nodemap_active);
268 * Reads and prints the nodemap ID for the given nodemap.
270 * \param m seq file in proc fs
274 static int nodemap_id_seq_show(struct seq_file *m, void *data)
276 struct lu_nodemap *nodemap = m->private;
278 return seq_printf(m, "%u\n", nodemap->nm_id);
280 LPROC_SEQ_FOPS_RO(nodemap_id);
283 * Reads and prints the root squash UID for the given nodemap.
285 * \param m seq file in proc fs
289 static int nodemap_squash_uid_seq_show(struct seq_file *m, void *data)
291 struct lu_nodemap *nodemap = m->private;
293 return seq_printf(m, "%u\n", nodemap->nm_squash_uid);
297 * Reads and prints the root squash GID for the given nodemap.
299 * \param m seq file in proc fs
303 static int nodemap_squash_gid_seq_show(struct seq_file *m, void *data)
305 struct lu_nodemap *nodemap = m->private;
307 return seq_printf(m, "%u\n", nodemap->nm_squash_gid);
311 * Reads and prints the trusted flag for the given nodemap.
313 * \param m seq file in proc fs
317 static int nodemap_trusted_seq_show(struct seq_file *m, void *data)
319 struct lu_nodemap *nodemap = m->private;
321 return seq_printf(m, "%d\n", (int)nodemap->nmf_trust_client_ids);
325 * Reads and prints the admin flag for the given nodemap.
327 * \param m seq file in proc fs
331 static int nodemap_admin_seq_show(struct seq_file *m, void *data)
333 struct lu_nodemap *nodemap = m->private;
335 return seq_printf(m, "%d\n", (int)nodemap->nmf_allow_root_access);
338 #ifdef NODEMAP_PROC_DEBUG
340 * Helper functions to set nodemap flags.
342 * \param[in] buffer string, which is "1" or "0" to set/unset flag
343 * \param[in] count \a buffer length
344 * \param[out] flag_p where to store flag value
345 * \retval \a count on success
346 * \retval negative number on error
348 static int nodemap_proc_read_flag(const char __user *buffer,
349 unsigned long count, unsigned int *flag_p)
351 char scratch[NODEMAP_LPROC_FLAG_LEN + 1];
352 long unsigned int flag_buf;
358 if (count >= sizeof(scratch))
361 if (copy_from_user(scratch, buffer, count))
364 scratch[count] = '\0';
365 rc = kstrtoul(scratch, 10, &flag_buf);
375 * Set the squash UID.
377 * \param[in] file proc file
378 * \param[in] buffer string representing squash UID to set
379 * \param[in] count \a buffer length
380 * \param[in] off unused
381 * \retval \a count on success
382 * \retval negative number on error
385 nodemap_squash_uid_seq_write(struct file *file, const char __user *buffer,
386 size_t count, loff_t *off)
388 char squash[NODEMAP_LPROC_ID_LEN + 1];
389 struct seq_file *m = file->private_data;
390 struct lu_nodemap *nodemap = m->private;
391 long unsigned int squash_uid;
397 if (count >= sizeof(squash))
400 if (copy_from_user(squash, buffer, count))
403 squash[count] = '\0';
404 rc = kstrtoul(squash, 10, &squash_uid);
408 nodemap->nm_squash_uid = squash_uid;
414 * Set the squash GID.
416 * \param[in] file proc file
417 * \param[in] buffer string representing squash GID to set
418 * \param[in] count \a buffer length
419 * \param[in] off unused
420 * \retval \a count on success
421 * \retval negative number on error
424 nodemap_squash_gid_seq_write(struct file *file, const char __user *buffer,
425 size_t count, loff_t *off)
427 char squash[NODEMAP_LPROC_ID_LEN + 1];
428 struct seq_file *m = file->private_data;
429 struct lu_nodemap *nodemap = m->private;
430 long unsigned int squash_gid;
436 if (count >= sizeof(squash))
439 if (copy_from_user(squash, buffer, count))
442 squash[count] = '\0';
443 rc = kstrtoul(squash, 10, &squash_gid);
447 nodemap->nm_squash_gid = squash_gid;
453 * Set/unset the trusted flag.
455 * \param[in] file proc file
456 * \param[in] buffer string, "1" or "0"
457 * \param[in] count \a buffer length
458 * \param[in] off unused
459 * \retval \a count on success
460 * \retval negative number on error
463 nodemap_trusted_seq_write(struct file *file, const char __user *buffer,
464 size_t count, loff_t *off)
466 struct seq_file *m = file->private_data;
467 struct lu_nodemap *nodemap = m->private;
471 rc = nodemap_proc_read_flag(buffer, count, &flags);
473 nodemap->nmf_trust_client_ids = !!flags;
474 nm_member_revoke_locks(nodemap);
481 * Set/unset the admin flag.
483 * \param[in] file proc file
484 * \param[in] buffer string, "1" or "0"
485 * \param[in] count \a buffer length
486 * \param[in] off unused
487 * \retval \a count on success
488 * \retval negative number on error
491 nodemap_admin_seq_write(struct file *file, const char __user *buffer,
492 size_t count, loff_t *off)
494 struct seq_file *m = file->private_data;
495 struct lu_nodemap *nodemap = m->private;
499 rc = nodemap_proc_read_flag(buffer, count, &flags);
501 nodemap->nmf_allow_root_access = !!flags;
502 nm_member_revoke_locks(nodemap);
511 * \param[in] file proc file
512 * \param[in] buffer string, name of the nodemap to add
513 * \param[in] count \a buffer length
514 * \param[in] off unused
515 * \retval \a count on success
516 * \retval negative number on error
519 lprocfs_add_nodemap_seq_write(struct file *file, const char __user *buffer,
520 size_t count, loff_t *off)
522 char nodemap_name[LUSTRE_NODEMAP_NAME_LENGTH + 1];
530 if (count >= sizeof(nodemap_name))
533 if (copy_from_user(nodemap_name, buffer, count))
536 nodemap_name[count] = '\0';
538 cpybuf = nodemap_name;
539 pos = strsep(&cpybuf, " \n");
543 rc = nodemap_add(nodemap_name);
549 LPROC_SEQ_FOPS_WO_TYPE(nodemap, add_nodemap);
554 * \param[in] file proc file
555 * \param[in] buffer string, name of the nodemap to delete
556 * \param[in] count \a buffer length
557 * \param[in] off unused
558 * \retval \a count on success
559 * \retval negative number on error
562 lprocfs_del_nodemap_seq_write(struct file *file, const char __user *buffer,
563 size_t count, loff_t *off)
565 char nodemap_name[LUSTRE_NODEMAP_NAME_LENGTH + 1];
573 if (count >= sizeof(nodemap_name))
576 if (copy_from_user(nodemap_name, buffer, count))
579 nodemap_name[count] = '\0';
581 cpybuf = nodemap_name;
582 pos = strsep(&cpybuf, " \n");
586 rc = nodemap_del(nodemap_name);
593 LPROC_SEQ_FOPS_WO_TYPE(nodemap, del_nodemap);
596 * Helper function to parse a NID string.
598 * \param[in] rangestr string representation of NIDs, see libcfs_str2nid()
599 * \param[out] nids array of two nids
600 * \retval 0 on success
601 * \retval negative number on error
603 static int parse_nids(char *rangestr, lnet_nid_t nids[2])
605 struct list_head nidlist;
606 char nidstr[2][LNET_NIDSTR_SIZE];
607 char nidrange_str[2 * LNET_NIDSTR_SIZE + 2];
610 INIT_LIST_HEAD(&nidlist);
612 if (cfs_parse_nidlist(rangestr, strlen(rangestr),
616 if (!cfs_nidrange_is_contiguous(&nidlist))
619 cfs_nidrange_find_min_max(&nidlist, nidstr[0], nidstr[1],
621 snprintf(nidrange_str, sizeof(nidrange_str), "%s:%s",
622 nidstr[0], nidstr[1]);
624 rc = nodemap_parse_range(nidrange_str, nids);
628 cfs_free_nidlist(&nidlist);
634 * Add a NID range to nodemap.
636 * \param[in] file proc file
637 * \param[in] buffer string, "<nodemap name> <nid range>"
638 * \param[in] count \a buffer length
639 * \param[in] off unused
640 * \retval \a count on success
641 * \retval negative number on error
644 lprocfs_add_nodemap_range_seq_write(struct file *file,
645 const char __user *buffer,
646 size_t count, loff_t *off)
648 char name_range[LUSTRE_NODEMAP_NAME_LENGTH +
649 LNET_NIDSTR_SIZE * 2 + 2];
652 char *rangestr = NULL;
659 if (count >= sizeof(name_range))
660 GOTO(out, rc = -EINVAL);
662 if (copy_from_user(name_range, buffer, count))
663 GOTO(out, rc = -EFAULT);
665 name_range[count] = '\0';
668 name = strsep(&cpybuf, " ");
670 GOTO(out, rc = -EINVAL);
672 rangestr = strsep(&cpybuf, " \n");
673 if (rangestr == NULL)
674 GOTO(out, rc = -EINVAL);
676 rc = parse_nids(rangestr, nids);
680 rc = nodemap_add_range(name, nids);
682 GOTO(out, rc = -EINVAL);
690 LPROC_SEQ_FOPS_WO_TYPE(nodemap, add_nodemap_range);
693 * Delete a NID range from nodemap.
695 * \param[in] file proc file
696 * \param[in] buffer string, "<nodemap name> <nid range>"
697 * \param[in] count \a buffer length
698 * \param[in] off unused
699 * \retval \a count on success
700 * \retval negative number on error
703 lprocfs_del_nodemap_range_seq_write(struct file *file,
704 const char __user *buffer,
705 size_t count, loff_t *off)
707 char name_range[LUSTRE_NODEMAP_NAME_LENGTH +
708 LNET_NIDSTR_SIZE * 2 + 2];
711 char *rangestr = NULL;
718 if (count >= sizeof(name_range))
719 GOTO(out, rc = -EINVAL);
721 if (copy_from_user(name_range, buffer, count))
722 GOTO(out, rc = -EFAULT);
724 name_range[count] = '\0';
727 name = strsep(&cpybuf, " ");
729 GOTO(out, rc = -EINVAL);
731 rangestr = strsep(&cpybuf, " \n");
732 if (rangestr == NULL)
733 GOTO(out, rc = -EINVAL);
735 rc = parse_nids(rangestr, nids);
739 rc = nodemap_del_range(name, nids);
741 GOTO(out, rc = -EINVAL);
749 LPROC_SEQ_FOPS_WO_TYPE(nodemap, del_nodemap_range);
752 * Add an idmap to nodemap.
754 * \param[in] file proc file
755 * \param[in] buffer string, "<nodemap name> <uid|gid> <idmap>"
756 * \param[in] count \a buffer length
757 * \param[in] off unused
758 * \retval \a count on success
759 * \retval negative number on error
762 lprocfs_add_nodemap_idmap_seq_write(struct file *file,
763 const char __user *buffer,
764 size_t count, loff_t *off)
766 char name_idmapstr[LUSTRE_NODEMAP_NAME_LENGTH + 16];
769 char *idtypestr = NULL;
770 char *idmapstr = NULL;
777 if (count >= sizeof(name_idmapstr))
778 GOTO(out, rc = -EINVAL);
780 if (copy_from_user(name_idmapstr, buffer, count))
781 GOTO(out, rc = -EFAULT);
783 name_idmapstr[count] = '\0';
785 cpybuf = name_idmapstr;
786 name = strsep(&cpybuf, " ");
788 GOTO(out, rc = -EINVAL);
790 idtypestr = strsep(&cpybuf, " ");
791 if (idtypestr == NULL)
792 GOTO(out, rc = -EINVAL);
794 idmapstr = strsep(&cpybuf, " \n");
795 if (idmapstr == NULL)
796 GOTO(out, rc = -EINVAL);
798 rc = nodemap_parse_idmap(idmapstr, idmap);
800 GOTO(out, rc = -EINVAL);
802 if (strcmp(idtypestr, "uid") == 0)
803 rc = nodemap_add_idmap(name, NODEMAP_UID, idmap);
804 else if (strcmp(idtypestr, "gid") == 0)
805 rc = nodemap_add_idmap(name, NODEMAP_GID, idmap);
807 GOTO(out, rc = -EINVAL);
810 GOTO(out, rc = -EINVAL);
818 LPROC_SEQ_FOPS_WO_TYPE(nodemap, add_nodemap_idmap);
821 * Delete an idmap from nodemap.
823 * \param[in] file proc file
824 * \param[in] buffer string, "<nodemap name> <uid|gid> <idmap>"
825 * \param[in] count \a buffer length
826 * \param[in] off unused
827 * \retval \a count on success
828 * \retval negative number on error
831 lprocfs_del_nodemap_idmap_seq_write(struct file *file,
832 const char __user *buffer,
833 size_t count, loff_t *off)
835 char name_idmapstr[LUSTRE_NODEMAP_NAME_LENGTH + 16];
838 char *idtypestr = NULL;
839 char *idmapstr = NULL;
846 if (count >= sizeof(name_idmapstr))
847 GOTO(out, rc = -EINVAL);
849 if (copy_from_user(name_idmapstr, buffer, count))
850 GOTO(out, rc = -EFAULT);
852 name_idmapstr[count] = '\0';
854 cpybuf = name_idmapstr;
855 name = strsep(&cpybuf, " ");
857 GOTO(out, rc = -EINVAL);
859 idtypestr = strsep(&cpybuf, " ");
860 if (idtypestr == NULL)
861 GOTO(out, rc = -EINVAL);
863 idmapstr = strsep(&cpybuf, " \n");
864 if (idmapstr == NULL)
865 GOTO(out, rc = -EINVAL);
867 rc = nodemap_parse_idmap(idmapstr, idmap);
869 GOTO(out, rc = -EINVAL);
871 if (strcmp(idtypestr, "uid") == 0)
872 rc = nodemap_del_idmap(name, NODEMAP_UID, idmap);
873 else if (strcmp(idtypestr, "gid") == 0)
874 rc = nodemap_del_idmap(name, NODEMAP_GID, idmap);
876 GOTO(out, rc = -EINVAL);
879 GOTO(out, rc = -EINVAL);
887 LPROC_SEQ_FOPS_WO_TYPE(nodemap, del_nodemap_idmap);
888 #endif /* NODEMAP_PROC_DEBUG */
890 static struct lprocfs_vars lprocfs_nm_module_vars[] = {
893 .fops = &nodemap_active_fops,
895 #ifdef NODEMAP_PROC_DEBUG
897 .name = "add_nodemap",
898 .fops = &nodemap_add_nodemap_fops,
901 .name = "remove_nodemap",
902 .fops = &nodemap_del_nodemap_fops,
905 .name = "add_nodemap_range",
906 .fops = &nodemap_add_nodemap_range_fops,
909 .name = "del_nodemap_range",
910 .fops = &nodemap_del_nodemap_range_fops,
913 .name = "add_nodemap_idmap",
914 .fops = &nodemap_add_nodemap_idmap_fops,
917 .name = "del_nodemap_idmap",
918 .fops = &nodemap_del_nodemap_idmap_fops,
920 #endif /* NODEMAP_PROC_DEBUG */
926 #ifdef NODEMAP_PROC_DEBUG
927 LPROC_SEQ_FOPS(nodemap_trusted);
928 LPROC_SEQ_FOPS(nodemap_admin);
929 LPROC_SEQ_FOPS(nodemap_squash_uid);
930 LPROC_SEQ_FOPS(nodemap_squash_gid);
932 LPROC_SEQ_FOPS_RO(nodemap_trusted);
933 LPROC_SEQ_FOPS_RO(nodemap_admin);
934 LPROC_SEQ_FOPS_RO(nodemap_squash_uid);
935 LPROC_SEQ_FOPS_RO(nodemap_squash_gid);
938 const struct file_operations nodemap_ranges_fops = {
939 .open = nodemap_ranges_open,
942 .release = single_release
945 const struct file_operations nodemap_idmap_fops = {
946 .open = nodemap_idmap_open,
949 .release = single_release
952 const struct file_operations nodemap_exports_fops = {
953 .open = nodemap_exports_open,
956 .release = single_release
959 static struct lprocfs_vars lprocfs_nodemap_vars[] = {
962 .fops = &nodemap_id_fops,
965 .name = "trusted_nodemap",
966 .fops = &nodemap_trusted_fops,
969 .name = "admin_nodemap",
970 .fops = &nodemap_admin_fops,
973 .name = "squash_uid",
974 .fops = &nodemap_squash_uid_fops,
977 .name = "squash_gid",
978 .fops = &nodemap_squash_gid_fops,
982 .fops = &nodemap_ranges_fops,
986 .fops = &nodemap_exports_fops,
990 .fops = &nodemap_idmap_fops,
997 static struct lprocfs_vars lprocfs_default_nodemap_vars[] = {
1000 .fops = &nodemap_id_fops,
1003 .name = "trusted_nodemap",
1004 .fops = &nodemap_trusted_fops,
1007 .name = "admin_nodemap",
1008 .fops = &nodemap_admin_fops,
1011 .name = "squash_uid",
1012 .fops = &nodemap_squash_uid_fops,
1015 .name = "squash_gid",
1016 .fops = &nodemap_squash_gid_fops,
1020 .fops = &nodemap_exports_fops,
1028 * Initialize the nodemap procfs directory.
1032 int nodemap_procfs_init(void)
1036 proc_lustre_nodemap_root = lprocfs_register(LUSTRE_NODEMAP_NAME,
1038 lprocfs_nm_module_vars,
1040 if (IS_ERR(proc_lustre_nodemap_root)) {
1041 rc = PTR_ERR(proc_lustre_nodemap_root);
1042 CERROR("cannot create 'nodemap' directory: rc = %d\n",
1044 proc_lustre_nodemap_root = NULL;
1050 * Register the proc directory for a nodemap
1052 * \param name name of nodemap
1053 * \param is_default: 1 if default nodemap
1056 int lprocfs_nodemap_register(const char *name,
1058 struct lu_nodemap *nodemap)
1060 struct proc_dir_entry *nodemap_proc_entry;
1064 nodemap_proc_entry =
1065 lprocfs_register(name, proc_lustre_nodemap_root,
1066 lprocfs_default_nodemap_vars,
1069 nodemap_proc_entry =
1070 lprocfs_register(name, proc_lustre_nodemap_root,
1071 lprocfs_nodemap_vars,
1074 if (IS_ERR(nodemap_proc_entry)) {
1075 rc = PTR_ERR(nodemap_proc_entry);
1076 CERROR("cannot create 'nodemap/%s': rc = %d\n", name, rc);
1077 nodemap_proc_entry = NULL;
1080 nodemap->nm_proc_entry = nodemap_proc_entry;