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, 2017, 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 static LIST_HEAD(nodemap_pde_list);
43 * Reads and prints the idmap for the given nodemap.
45 * \param m seq file in proc fs
49 static int nodemap_idmap_show(struct seq_file *m, void *data)
51 struct lu_nodemap *nodemap;
52 struct lu_idmap *idmap;
57 mutex_lock(&active_config_lock);
58 nodemap = nodemap_lookup(m->private);
59 mutex_unlock(&active_config_lock);
60 if (IS_ERR(nodemap)) {
61 rc = PTR_ERR(nodemap);
62 CERROR("cannot find nodemap '%s': rc = %d\n",
63 (char *)m->private, rc);
68 down_read(&nodemap->nm_idmap_lock);
69 for (node = rb_first(&nodemap->nm_client_to_fs_uidmap); node;
70 node = rb_next(node)) {
74 idmap = rb_entry(node, struct lu_idmap, id_client_to_fs);
76 seq_printf(m, " { idtype: uid, client_id: %u, "
77 "fs_id: %u }", idmap->id_client,
80 for (node = rb_first(&nodemap->nm_client_to_fs_gidmap);
81 node; node = rb_next(node)) {
84 idmap = rb_entry(node, struct lu_idmap, id_client_to_fs);
86 seq_printf(m, " { idtype: gid, client_id: %u, "
87 "fs_id: %u }", idmap->id_client,
90 for (node = rb_first(&nodemap->nm_client_to_fs_projidmap);
91 node; node = rb_next(node)) {
94 idmap = rb_entry(node, struct lu_idmap, id_client_to_fs);
97 " { idtype: projid, client_id: %u, fs_id: %u }",
101 up_read(&nodemap->nm_idmap_lock);
103 seq_printf(m, "]\n");
105 nodemap_putref(nodemap);
110 * Attaches nodemap_idmap_show to proc file.
112 * \param inode inode of seq file in proc fs
113 * \param file seq file
116 static int nodemap_idmap_open(struct inode *inode, struct file *file)
118 return single_open(file, nodemap_idmap_show, PDE_DATA(inode));
122 * Reads and prints the NID ranges for the given nodemap.
124 * \param m seq file in proc fs
128 static int nodemap_ranges_show(struct seq_file *m, void *data)
130 struct lu_nodemap *nodemap;
131 struct lu_nid_range *range;
132 char start_nidstr[LNET_NIDSTR_SIZE];
133 char end_nidstr[LNET_NIDSTR_SIZE];
137 mutex_lock(&active_config_lock);
138 nodemap = nodemap_lookup(m->private);
139 if (IS_ERR(nodemap)) {
140 mutex_unlock(&active_config_lock);
141 rc = PTR_ERR(nodemap);
142 CERROR("cannot find nodemap '%s': rc = %d\n",
143 (char *)m->private, rc);
147 seq_printf(m, "[\n");
148 down_read(&active_config->nmc_range_tree_lock);
149 list_for_each_entry(range, &nodemap->nm_ranges, rn_list) {
151 seq_printf(m, ",\n");
153 libcfs_nid2str_r(range->rn_start, start_nidstr, sizeof(start_nidstr));
154 libcfs_nid2str_r(range->rn_end, end_nidstr, sizeof(end_nidstr));
155 seq_printf(m, " { id: %u, start_nid: %s, end_nid: %s }",
156 range->rn_id, start_nidstr, end_nidstr);
158 up_read(&active_config->nmc_range_tree_lock);
159 mutex_unlock(&active_config_lock);
161 seq_printf(m, "]\n");
163 nodemap_putref(nodemap);
168 * Connects nodemap_idmap_show to proc file.
170 * \param inode inode of seq file in proc fs
171 * \param file seq file
174 static int nodemap_ranges_open(struct inode *inode, struct file *file)
176 return single_open(file, nodemap_ranges_show, PDE_DATA(inode));
180 * Reads and prints the fileset for the given nodemap.
182 * \param m seq file in proc fs
186 static int nodemap_fileset_seq_show(struct seq_file *m, void *data)
188 struct lu_nodemap *nodemap;
191 mutex_lock(&active_config_lock);
192 nodemap = nodemap_lookup(m->private);
193 mutex_unlock(&active_config_lock);
194 if (IS_ERR(nodemap)) {
195 rc = PTR_ERR(nodemap);
196 CERROR("cannot find nodemap '%s': rc = %d\n",
197 (char *)m->private, rc);
201 seq_printf(m, "%s\n", nodemap->nm_fileset);
202 nodemap_putref(nodemap);
207 * Set a fileset on a nodemap.
209 * \param[in] file proc file
210 * \param[in] buffer string, "<fileset>"
211 * \param[in] count \a buffer length
212 * \param[in] off unused
213 * \retval \a count on success
214 * \retval negative number on error
217 nodemap_fileset_seq_write(struct file *file,
218 const char __user *buffer,
219 size_t count, loff_t *off)
221 struct seq_file *m = file->private_data;
229 if (count > PATH_MAX)
232 OBD_ALLOC(nm_fileset, count + 1);
233 /* OBD_ALLOC zero-fills the buffer */
234 if (nm_fileset == NULL)
237 if (copy_from_user(nm_fileset, buffer, count))
238 GOTO(out, rc = -EFAULT);
240 rc = nodemap_set_fileset(m->private, nm_fileset);
242 GOTO(out, rc = -EINVAL);
246 OBD_FREE(nm_fileset, count + 1);
250 LPROC_SEQ_FOPS(nodemap_fileset);
253 * Reads and prints the SELinux policy info for the given nodemap.
255 * \param m seq file in proc fs
259 static int nodemap_sepol_seq_show(struct seq_file *m, void *data)
261 struct lu_nodemap *nodemap;
264 mutex_lock(&active_config_lock);
265 nodemap = nodemap_lookup(m->private);
266 mutex_unlock(&active_config_lock);
267 if (IS_ERR(nodemap)) {
268 rc = PTR_ERR(nodemap);
269 CERROR("cannot find nodemap '%s': rc = %d\n",
270 (char *)m->private, rc);
274 seq_printf(m, "%s\n", nodemap_get_sepol(nodemap));
275 nodemap_putref(nodemap);
280 * Set SELinux policy info on a nodemap.
282 * \param[in] file proc file
283 * \param[in] buffer string, "<sepol>"
284 * \param[in] count \a buffer length
285 * \param[in] off unused
286 * \retval \a count on success
287 * \retval negative number on error
290 nodemap_sepol_seq_write(struct file *file,
291 const char __user *buffer,
292 size_t count, loff_t *off)
294 struct seq_file *m = file->private_data;
295 char sepol[LUSTRE_NODEMAP_SEPOL_LENGTH + 1];
298 BUILD_BUG_ON(sizeof(sepol) !=
299 sizeof(((struct lu_nodemap *)0)->nm_sepol));
302 if (count >= sizeof(sepol))
303 GOTO(out, rc = -ENAMETOOLONG);
305 if (copy_from_user(sepol, buffer, count))
306 GOTO(out, rc = -EFAULT);
310 rc = nodemap_set_sepol(m->private, sepol);
319 LPROC_SEQ_FOPS(nodemap_sepol);
322 * Reads and prints the exports attached to the given nodemap.
324 * \param m seq file in proc fs, stores nodemap
328 static int nodemap_exports_show(struct seq_file *m, void *data)
330 struct lu_nodemap *nodemap;
331 struct obd_export *exp;
332 char nidstr[LNET_NIDSTR_SIZE] = "<unknown>";
335 mutex_lock(&active_config_lock);
336 nodemap = nodemap_lookup(m->private);
337 mutex_unlock(&active_config_lock);
338 if (IS_ERR(nodemap)) {
339 rc = PTR_ERR(nodemap);
340 CERROR("cannot find nodemap '%s': rc = %d\n",
341 (char *)m->private, rc);
345 seq_printf(m, "[\n");
347 mutex_lock(&nodemap->nm_member_list_lock);
348 list_for_each_entry(exp, &nodemap->nm_member_list,
349 exp_target_data.ted_nodemap_member) {
350 if (exp->exp_connection != NULL)
351 libcfs_nidstr_r(&exp->exp_connection->c_peer.nid,
352 nidstr, sizeof(nidstr));
354 seq_printf(m, " { nid: %s, uuid: %s },",
355 nidstr, exp->exp_client_uuid.uuid);
357 mutex_unlock(&nodemap->nm_member_list_lock);
360 seq_printf(m, "]\n");
362 nodemap_putref(nodemap);
367 * Attaches nodemap_idmap_show to proc file.
369 * \param inode inode of seq file in proc fs
370 * \param file seq file
373 static int nodemap_exports_open(struct inode *inode, struct file *file)
375 return single_open(file, nodemap_exports_show, PDE_DATA(inode));
379 * Reads and prints the active flag for the given nodemap.
381 * \param m seq file in proc fs
385 static int nodemap_active_seq_show(struct seq_file *m, void *data)
387 seq_printf(m, "%u\n", (unsigned int)nodemap_active);
392 * Activate/deactivate nodemap.
394 * \param[in] file proc file
395 * \param[in] buffer string, "1" or "0" to activate/deactivate nodemap
396 * \param[in] count \a buffer length
397 * \param[in] off unused
398 * \retval \a count on success
399 * \retval negative number on error
402 nodemap_active_seq_write(struct file *file, const char __user *buffer,
403 size_t count, loff_t *off)
405 char active_string[NODEMAP_LPROC_FLAG_LEN + 1];
406 long unsigned int active;
412 if (count >= sizeof(active_string))
415 if (copy_from_user(active_string, buffer, count))
418 active_string[count] = '\0';
419 rc = kstrtoul(active_string, 10, &active);
423 nodemap_activate(active);
427 LPROC_SEQ_FOPS(nodemap_active);
430 * Reads and prints the nodemap ID for the given nodemap.
432 * \param m seq file in proc fs
436 static int nodemap_id_seq_show(struct seq_file *m, void *data)
438 struct lu_nodemap *nodemap;
440 mutex_lock(&active_config_lock);
441 nodemap = nodemap_lookup(m->private);
442 mutex_unlock(&active_config_lock);
443 if (IS_ERR(nodemap)) {
444 int rc = PTR_ERR(nodemap);
445 CERROR("cannot find nodemap '%s': rc = %d\n",
446 (char *)m->private, rc);
450 seq_printf(m, "%u\n", nodemap->nm_id);
451 nodemap_putref(nodemap);
454 LPROC_SEQ_FOPS_RO(nodemap_id);
457 * Reads and prints the root squash UID for the given nodemap.
459 * \param m seq file in proc fs
463 static int nodemap_squash_uid_seq_show(struct seq_file *m, void *data)
465 struct lu_nodemap *nodemap;
467 mutex_lock(&active_config_lock);
468 nodemap = nodemap_lookup(m->private);
469 mutex_unlock(&active_config_lock);
470 if (IS_ERR(nodemap)) {
471 int rc = PTR_ERR(nodemap);
472 CERROR("cannot find nodemap '%s': rc = %d\n",
473 (char *)m->private, rc);
477 seq_printf(m, "%u\n", nodemap->nm_squash_uid);
478 nodemap_putref(nodemap);
483 * Reads and prints the root squash GID for the given nodemap.
485 * \param m seq file in proc fs
489 static int nodemap_squash_gid_seq_show(struct seq_file *m, void *data)
491 struct lu_nodemap *nodemap;
493 mutex_lock(&active_config_lock);
494 nodemap = nodemap_lookup(m->private);
495 mutex_unlock(&active_config_lock);
496 if (IS_ERR(nodemap)) {
497 int rc = PTR_ERR(nodemap);
498 CERROR("cannot find nodemap '%s': rc = %d\n",
499 (char *)m->private, rc);
503 seq_printf(m, "%u\n", nodemap->nm_squash_gid);
504 nodemap_putref(nodemap);
509 * Reads and prints the squash PROJID for the given nodemap.
511 * \param m seq file in proc fs
515 static int nodemap_squash_projid_seq_show(struct seq_file *m, void *data)
517 struct lu_nodemap *nodemap;
519 mutex_lock(&active_config_lock);
520 nodemap = nodemap_lookup(m->private);
521 mutex_unlock(&active_config_lock);
522 if (IS_ERR(nodemap)) {
523 int rc = PTR_ERR(nodemap);
525 CERROR("cannot find nodemap '%s': rc = %d\n",
526 (char *)m->private, rc);
530 seq_printf(m, "%u\n", nodemap->nm_squash_projid);
531 nodemap_putref(nodemap);
536 * Reads and prints the trusted flag for the given nodemap.
538 * \param m seq file in proc fs
542 static int nodemap_trusted_seq_show(struct seq_file *m, void *data)
544 struct lu_nodemap *nodemap;
546 mutex_lock(&active_config_lock);
547 nodemap = nodemap_lookup(m->private);
548 mutex_unlock(&active_config_lock);
549 if (IS_ERR(nodemap)) {
550 int rc = PTR_ERR(nodemap);
552 CERROR("cannot find nodemap '%s': rc = %d\n",
553 (char *)m->private, rc);
557 seq_printf(m, "%d\n", (int)nodemap->nmf_trust_client_ids);
558 nodemap_putref(nodemap);
563 * Reads and prints the admin flag for the given nodemap.
565 * \param m seq file in proc fs
569 static int nodemap_admin_seq_show(struct seq_file *m, void *data)
571 struct lu_nodemap *nodemap;
574 mutex_lock(&active_config_lock);
575 nodemap = nodemap_lookup(m->private);
576 mutex_unlock(&active_config_lock);
577 if (IS_ERR(nodemap)) {
578 rc = PTR_ERR(nodemap);
579 CERROR("cannot find nodemap '%s': rc = %d\n",
580 (char *)m->private, rc);
584 seq_printf(m, "%d\n", (int)nodemap->nmf_allow_root_access);
585 nodemap_putref(nodemap);
590 * Reads and prints the mapping mode for the given nodemap.
592 * \param m seq file in proc fs
596 static int nodemap_map_mode_seq_show(struct seq_file *m, void *data)
598 struct lu_nodemap *nodemap;
599 bool need_sep = false;
602 mutex_lock(&active_config_lock);
603 nodemap = nodemap_lookup(m->private);
604 mutex_unlock(&active_config_lock);
605 if (IS_ERR(nodemap)) {
606 rc = PTR_ERR(nodemap);
607 CERROR("cannot find nodemap '%s': rc = %d\n",
608 (char *)m->private, rc);
612 if (nodemap->nmf_map_mode == NODEMAP_MAP_ALL) {
613 seq_puts(m, "all\n");
615 if (nodemap->nmf_map_mode & NODEMAP_MAP_UID) {
619 if (nodemap->nmf_map_mode & NODEMAP_MAP_GID) {
620 seq_puts(m, need_sep ? ",gid" : "gid");
623 if (nodemap->nmf_map_mode & NODEMAP_MAP_PROJID)
624 seq_puts(m, need_sep ? ",projid" : "projid");
628 nodemap_putref(nodemap);
633 * Reads and prints the deny_unknown flag for the given nodemap.
635 * \param m seq file in proc fs
639 static int nodemap_deny_unknown_seq_show(struct seq_file *m, void *data)
641 struct lu_nodemap *nodemap;
644 mutex_lock(&active_config_lock);
645 nodemap = nodemap_lookup(m->private);
646 mutex_unlock(&active_config_lock);
647 if (IS_ERR(nodemap)) {
648 rc = PTR_ERR(nodemap);
649 CERROR("cannot find nodemap '%s': rc = %d\n",
650 (char *)m->private, rc);
654 seq_printf(m, "%d\n", (int)nodemap->nmf_deny_unknown);
655 nodemap_putref(nodemap);
660 * Reads and prints the audit_mode flag for the given nodemap.
662 * \param m seq file in proc fs
666 static int nodemap_audit_mode_seq_show(struct seq_file *m, void *data)
668 struct lu_nodemap *nodemap;
671 mutex_lock(&active_config_lock);
672 nodemap = nodemap_lookup(m->private);
673 mutex_unlock(&active_config_lock);
674 if (IS_ERR(nodemap)) {
675 rc = PTR_ERR(nodemap);
676 CERROR("cannot find nodemap '%s': rc = %d\n",
677 (char *)m->private, rc);
681 seq_printf(m, "%d\n", (int)nodemap->nmf_enable_audit);
682 nodemap_putref(nodemap);
687 * Reads and prints the forbid_encryption flag for the given nodemap.
689 * \param m seq file in proc fs
693 static int nodemap_forbid_encryption_seq_show(struct seq_file *m, void *data)
695 struct lu_nodemap *nodemap;
698 mutex_lock(&active_config_lock);
699 nodemap = nodemap_lookup(m->private);
700 mutex_unlock(&active_config_lock);
701 if (IS_ERR(nodemap)) {
702 rc = PTR_ERR(nodemap);
703 CERROR("cannot find nodemap '%s': rc = %d\n",
704 (char *)m->private, rc);
708 seq_printf(m, "%d\n", (int)nodemap->nmf_forbid_encryption);
709 nodemap_putref(nodemap);
714 * Reads and prints the readonly_mount flag for the given nodemap.
716 * \param m seq file in proc fs
720 static int nodemap_readonly_mount_seq_show(struct seq_file *m, void *data)
722 struct lu_nodemap *nodemap;
725 mutex_lock(&active_config_lock);
726 nodemap = nodemap_lookup(m->private);
727 mutex_unlock(&active_config_lock);
728 if (IS_ERR(nodemap)) {
729 rc = PTR_ERR(nodemap);
730 CERROR("cannot find nodemap '%s': rc = %d\n",
731 (char *)m->private, rc);
735 seq_printf(m, "%d\n", (int)nodemap->nmf_readonly_mount);
736 nodemap_putref(nodemap);
740 static struct lprocfs_vars lprocfs_nm_module_vars[] = {
743 .fops = &nodemap_active_fops,
750 LPROC_SEQ_FOPS_RO(nodemap_trusted);
751 LPROC_SEQ_FOPS_RO(nodemap_admin);
752 LPROC_SEQ_FOPS_RO(nodemap_squash_uid);
753 LPROC_SEQ_FOPS_RO(nodemap_squash_gid);
754 LPROC_SEQ_FOPS_RO(nodemap_squash_projid);
756 LPROC_SEQ_FOPS_RO(nodemap_deny_unknown);
757 LPROC_SEQ_FOPS_RO(nodemap_map_mode);
758 LPROC_SEQ_FOPS_RO(nodemap_audit_mode);
759 LPROC_SEQ_FOPS_RO(nodemap_forbid_encryption);
760 LPROC_SEQ_FOPS_RO(nodemap_readonly_mount);
762 static const struct proc_ops nodemap_ranges_fops = {
763 .proc_open = nodemap_ranges_open,
764 .proc_read = seq_read,
765 .proc_lseek = seq_lseek,
766 .proc_release = single_release
769 static const struct proc_ops nodemap_idmap_fops = {
770 .proc_open = nodemap_idmap_open,
771 .proc_read = seq_read,
772 .proc_lseek = seq_lseek,
773 .proc_release = single_release
776 static const struct proc_ops nodemap_exports_fops = {
777 .proc_open = nodemap_exports_open,
778 .proc_read = seq_read,
779 .proc_lseek = seq_lseek,
780 .proc_release = single_release
783 static struct lprocfs_vars lprocfs_nodemap_vars[] = {
786 .fops = &nodemap_id_fops,
789 .name = "trusted_nodemap",
790 .fops = &nodemap_trusted_fops,
793 .name = "admin_nodemap",
794 .fops = &nodemap_admin_fops,
797 .name = "deny_unknown",
798 .fops = &nodemap_deny_unknown_fops,
802 .fops = &nodemap_map_mode_fops,
805 .name = "audit_mode",
806 .fops = &nodemap_audit_mode_fops,
809 .name = "forbid_encryption",
810 .fops = &nodemap_forbid_encryption_fops,
813 .name = "readonly_mount",
814 .fops = &nodemap_readonly_mount_fops,
817 .name = "squash_uid",
818 .fops = &nodemap_squash_uid_fops,
821 .name = "squash_gid",
822 .fops = &nodemap_squash_gid_fops,
825 .name = "squash_projid",
826 .fops = &nodemap_squash_projid_fops,
830 .fops = &nodemap_ranges_fops,
834 .fops = &nodemap_fileset_fops,
838 .fops = &nodemap_sepol_fops,
842 .fops = &nodemap_exports_fops,
846 .fops = &nodemap_idmap_fops,
853 static struct lprocfs_vars lprocfs_default_nodemap_vars[] = {
856 .fops = &nodemap_id_fops,
859 .name = "trusted_nodemap",
860 .fops = &nodemap_trusted_fops,
863 .name = "admin_nodemap",
864 .fops = &nodemap_admin_fops,
867 .name = "deny_unknown",
868 .fops = &nodemap_deny_unknown_fops,
871 .name = "squash_uid",
872 .fops = &nodemap_squash_uid_fops,
875 .name = "squash_gid",
876 .fops = &nodemap_squash_gid_fops,
879 .name = "squash_projid",
880 .fops = &nodemap_squash_projid_fops,
884 .fops = &nodemap_fileset_fops,
888 .fops = &nodemap_exports_fops,
891 .name = "audit_mode",
892 .fops = &nodemap_audit_mode_fops,
895 .name = "forbid_encryption",
896 .fops = &nodemap_forbid_encryption_fops,
899 .name = "readonly_mount",
900 .fops = &nodemap_readonly_mount_fops,
908 * Initialize the nodemap procfs directory.
912 int nodemap_procfs_init(void)
916 proc_lustre_nodemap_root = lprocfs_register(LUSTRE_NODEMAP_NAME,
918 lprocfs_nm_module_vars,
920 if (IS_ERR(proc_lustre_nodemap_root)) {
921 rc = PTR_ERR(proc_lustre_nodemap_root);
922 CERROR("cannot create 'nodemap' directory: rc = %d\n",
924 proc_lustre_nodemap_root = NULL;
930 * Cleanup nodemap proc entry data structures.
932 void nodemap_procfs_exit(void)
934 struct nodemap_pde *nm_pde;
935 struct nodemap_pde *tmp;
937 lprocfs_remove(&proc_lustre_nodemap_root);
938 list_for_each_entry_safe(nm_pde, tmp, &nodemap_pde_list,
940 list_del(&nm_pde->npe_list_member);
941 OBD_FREE_PTR(nm_pde);
946 * Remove a nodemap's procfs entry and related data.
948 void lprocfs_nodemap_remove(struct nodemap_pde *nm_pde)
950 lprocfs_remove(&nm_pde->npe_proc_entry);
951 list_del(&nm_pde->npe_list_member);
952 OBD_FREE_PTR(nm_pde);
956 * Register the proc directory for a nodemap
958 * \param nodemap nodemap to make the proc dir for
959 * \param is_default: 1 if default nodemap
962 int lprocfs_nodemap_register(struct lu_nodemap *nodemap, bool is_default)
964 struct nodemap_pde *nm_entry;
967 OBD_ALLOC_PTR(nm_entry);
968 if (nm_entry == NULL)
969 GOTO(out, rc = -ENOMEM);
971 nm_entry->npe_proc_entry = proc_mkdir(nodemap->nm_name,
972 proc_lustre_nodemap_root);
973 if (IS_ERR(nm_entry->npe_proc_entry))
974 GOTO(out, rc = PTR_ERR(nm_entry->npe_proc_entry));
976 snprintf(nm_entry->npe_name, sizeof(nm_entry->npe_name), "%s",
979 /* Use the nodemap name as stored on the PDE as the private data. This
980 * is so a nodemap struct can be replaced without updating the proc
983 rc = lprocfs_add_vars(nm_entry->npe_proc_entry,
984 (is_default ? lprocfs_default_nodemap_vars :
985 lprocfs_nodemap_vars),
988 lprocfs_remove(&nm_entry->npe_proc_entry);
990 list_add(&nm_entry->npe_list_member, &nodemap_pde_list);
994 CERROR("cannot create 'nodemap/%s': rc = %d\n",
995 nodemap->nm_name, rc);
996 if (nm_entry != NULL) {
997 OBD_FREE_PTR(nm_entry);
1002 nodemap->nm_pde_data = nm_entry;