]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - drivers/staging/lustre/lustre/libcfs/module.c
Merge branches 'pm-cpu', 'pm-cpuidle' and 'pm-domains'
[mirror_ubuntu-zesty-kernel.git] / drivers / staging / lustre / lustre / libcfs / module.c
1 /*
2 * GPL HEADER START
3 *
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
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.
9 *
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).
15 *
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
19 *
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
22 * have any questions.
23 *
24 * GPL HEADER END
25 */
26 /*
27 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
29 *
30 * Copyright (c) 2012, Intel Corporation.
31 */
32 /*
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
35 */
36 #include <linux/module.h>
37 #include <linux/kernel.h>
38 #include <linux/mm.h>
39 #include <linux/string.h>
40 #include <linux/stat.h>
41 #include <linux/errno.h>
42 #include <linux/unistd.h>
43 #include <net/sock.h>
44 #include <linux/uio.h>
45
46 #include <linux/uaccess.h>
47
48 #include <linux/fs.h>
49 #include <linux/file.h>
50 #include <linux/list.h>
51
52 #include <linux/sysctl.h>
53 #include <linux/debugfs.h>
54
55 # define DEBUG_SUBSYSTEM S_LNET
56
57 #include "../../include/linux/libcfs/libcfs.h"
58 #include <asm/div64.h>
59
60 #include "../../include/linux/libcfs/libcfs_crypto.h"
61 #include "../../include/linux/lnet/lib-lnet.h"
62 #include "../../include/linux/lnet/lnet.h"
63 #include "tracefile.h"
64
65 MODULE_AUTHOR("Peter J. Braam <braam@clusterfs.com>");
66 MODULE_DESCRIPTION("Portals v3.1");
67 MODULE_LICENSE("GPL");
68
69 static void insert_debugfs(void);
70 static void remove_debugfs(void);
71
72 static struct dentry *lnet_debugfs_root;
73
74 static void kportal_memhog_free(struct libcfs_device_userstate *ldu)
75 {
76 struct page **level0p = &ldu->ldu_memhog_root_page;
77 struct page **level1p;
78 struct page **level2p;
79 int count1;
80 int count2;
81
82 if (*level0p != NULL) {
83
84 level1p = (struct page **)page_address(*level0p);
85 count1 = 0;
86
87 while (count1 < PAGE_CACHE_SIZE/sizeof(struct page *) &&
88 *level1p != NULL) {
89
90 level2p = (struct page **)page_address(*level1p);
91 count2 = 0;
92
93 while (count2 < PAGE_CACHE_SIZE/sizeof(struct page *) &&
94 *level2p != NULL) {
95
96 __free_page(*level2p);
97 ldu->ldu_memhog_pages--;
98 level2p++;
99 count2++;
100 }
101
102 __free_page(*level1p);
103 ldu->ldu_memhog_pages--;
104 level1p++;
105 count1++;
106 }
107
108 __free_page(*level0p);
109 ldu->ldu_memhog_pages--;
110
111 *level0p = NULL;
112 }
113
114 LASSERT(ldu->ldu_memhog_pages == 0);
115 }
116
117 static int kportal_memhog_alloc(struct libcfs_device_userstate *ldu, int npages,
118 gfp_t flags)
119 {
120 struct page **level0p;
121 struct page **level1p;
122 struct page **level2p;
123 int count1;
124 int count2;
125
126 LASSERT(ldu->ldu_memhog_pages == 0);
127 LASSERT(ldu->ldu_memhog_root_page == NULL);
128
129 if (npages < 0)
130 return -EINVAL;
131
132 if (npages == 0)
133 return 0;
134
135 level0p = &ldu->ldu_memhog_root_page;
136 *level0p = alloc_page(flags);
137 if (*level0p == NULL)
138 return -ENOMEM;
139 ldu->ldu_memhog_pages++;
140
141 level1p = (struct page **)page_address(*level0p);
142 count1 = 0;
143 memset(level1p, 0, PAGE_CACHE_SIZE);
144
145 while (ldu->ldu_memhog_pages < npages &&
146 count1 < PAGE_CACHE_SIZE/sizeof(struct page *)) {
147
148 if (cfs_signal_pending())
149 return -EINTR;
150
151 *level1p = alloc_page(flags);
152 if (*level1p == NULL)
153 return -ENOMEM;
154 ldu->ldu_memhog_pages++;
155
156 level2p = (struct page **)page_address(*level1p);
157 count2 = 0;
158 memset(level2p, 0, PAGE_CACHE_SIZE);
159
160 while (ldu->ldu_memhog_pages < npages &&
161 count2 < PAGE_CACHE_SIZE/sizeof(struct page *)) {
162
163 if (cfs_signal_pending())
164 return -EINTR;
165
166 *level2p = alloc_page(flags);
167 if (*level2p == NULL)
168 return -ENOMEM;
169 ldu->ldu_memhog_pages++;
170
171 level2p++;
172 count2++;
173 }
174
175 level1p++;
176 count1++;
177 }
178
179 return 0;
180 }
181
182 /* called when opening /dev/device */
183 static int libcfs_psdev_open(unsigned long flags, void *args)
184 {
185 struct libcfs_device_userstate *ldu;
186
187 try_module_get(THIS_MODULE);
188
189 LIBCFS_ALLOC(ldu, sizeof(*ldu));
190 if (ldu != NULL) {
191 ldu->ldu_memhog_pages = 0;
192 ldu->ldu_memhog_root_page = NULL;
193 }
194 *(struct libcfs_device_userstate **)args = ldu;
195
196 return 0;
197 }
198
199 /* called when closing /dev/device */
200 static int libcfs_psdev_release(unsigned long flags, void *args)
201 {
202 struct libcfs_device_userstate *ldu;
203
204 ldu = (struct libcfs_device_userstate *)args;
205 if (ldu != NULL) {
206 kportal_memhog_free(ldu);
207 LIBCFS_FREE(ldu, sizeof(*ldu));
208 }
209
210 module_put(THIS_MODULE);
211 return 0;
212 }
213
214 static DECLARE_RWSEM(ioctl_list_sem);
215 static LIST_HEAD(ioctl_list);
216
217 int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand)
218 {
219 int rc = 0;
220
221 down_write(&ioctl_list_sem);
222 if (!list_empty(&hand->item))
223 rc = -EBUSY;
224 else
225 list_add_tail(&hand->item, &ioctl_list);
226 up_write(&ioctl_list_sem);
227
228 return rc;
229 }
230 EXPORT_SYMBOL(libcfs_register_ioctl);
231
232 int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand)
233 {
234 int rc = 0;
235
236 down_write(&ioctl_list_sem);
237 if (list_empty(&hand->item))
238 rc = -ENOENT;
239 else
240 list_del_init(&hand->item);
241 up_write(&ioctl_list_sem);
242
243 return rc;
244 }
245 EXPORT_SYMBOL(libcfs_deregister_ioctl);
246
247 static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd,
248 void *arg, struct libcfs_ioctl_data *data)
249 {
250 int err = -EINVAL;
251
252 switch (cmd) {
253 case IOC_LIBCFS_CLEAR_DEBUG:
254 libcfs_debug_clear_buffer();
255 return 0;
256 /*
257 * case IOC_LIBCFS_PANIC:
258 * Handled in arch/cfs_module.c
259 */
260 case IOC_LIBCFS_MARK_DEBUG:
261 if (data->ioc_inlbuf1 == NULL ||
262 data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0')
263 return -EINVAL;
264 libcfs_debug_mark_buffer(data->ioc_inlbuf1);
265 return 0;
266 case IOC_LIBCFS_MEMHOG:
267 if (pfile->private_data == NULL) {
268 err = -EINVAL;
269 } else {
270 kportal_memhog_free(pfile->private_data);
271 /* XXX The ioc_flags is not GFP flags now, need to be fixed */
272 err = kportal_memhog_alloc(pfile->private_data,
273 data->ioc_count,
274 data->ioc_flags);
275 if (err != 0)
276 kportal_memhog_free(pfile->private_data);
277 }
278 break;
279
280 case IOC_LIBCFS_PING_TEST: {
281 extern void (kping_client)(struct libcfs_ioctl_data *);
282 void (*ping)(struct libcfs_ioctl_data *);
283
284 CDEBUG(D_IOCTL, "doing %d pings to nid %s (%s)\n",
285 data->ioc_count, libcfs_nid2str(data->ioc_nid),
286 libcfs_nid2str(data->ioc_nid));
287 ping = symbol_get(kping_client);
288 if (!ping)
289 CERROR("symbol_get failed\n");
290 else {
291 ping(data);
292 symbol_put(kping_client);
293 }
294 return 0;
295 }
296
297 default: {
298 struct libcfs_ioctl_handler *hand;
299 err = -EINVAL;
300 down_read(&ioctl_list_sem);
301 list_for_each_entry(hand, &ioctl_list, item) {
302 err = hand->handle_ioctl(cmd, data);
303 if (err != -EINVAL) {
304 if (err == 0)
305 err = libcfs_ioctl_popdata(arg,
306 data, sizeof(*data));
307 break;
308 }
309 }
310 up_read(&ioctl_list_sem);
311 break;
312 }
313 }
314
315 return err;
316 }
317
318 static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg)
319 {
320 char *buf;
321 struct libcfs_ioctl_data *data;
322 int err = 0;
323
324 LIBCFS_ALLOC_GFP(buf, 1024, GFP_IOFS);
325 if (buf == NULL)
326 return -ENOMEM;
327
328 /* 'cmd' and permissions get checked in our arch-specific caller */
329 if (libcfs_ioctl_getdata(buf, buf + 800, arg)) {
330 CERROR("PORTALS ioctl: data error\n");
331 err = -EINVAL;
332 goto out;
333 }
334 data = (struct libcfs_ioctl_data *)buf;
335
336 err = libcfs_ioctl_int(pfile, cmd, arg, data);
337
338 out:
339 LIBCFS_FREE(buf, 1024);
340 return err;
341 }
342
343
344 struct cfs_psdev_ops libcfs_psdev_ops = {
345 libcfs_psdev_open,
346 libcfs_psdev_release,
347 NULL,
348 NULL,
349 libcfs_ioctl
350 };
351
352 static int init_libcfs_module(void)
353 {
354 int rc;
355
356 libcfs_arch_init();
357 libcfs_init_nidstrings();
358
359 rc = libcfs_debug_init(5 * 1024 * 1024);
360 if (rc < 0) {
361 pr_err("LustreError: libcfs_debug_init: %d\n", rc);
362 return rc;
363 }
364
365 rc = cfs_cpu_init();
366 if (rc != 0)
367 goto cleanup_debug;
368
369 rc = misc_register(&libcfs_dev);
370 if (rc) {
371 CERROR("misc_register: error %d\n", rc);
372 goto cleanup_cpu;
373 }
374
375 rc = cfs_wi_startup();
376 if (rc) {
377 CERROR("initialize workitem: error %d\n", rc);
378 goto cleanup_deregister;
379 }
380
381 /* max to 4 threads, should be enough for rehash */
382 rc = min(cfs_cpt_weight(cfs_cpt_table, CFS_CPT_ANY), 4);
383 rc = cfs_wi_sched_create("cfs_rh", cfs_cpt_table, CFS_CPT_ANY,
384 rc, &cfs_sched_rehash);
385 if (rc != 0) {
386 CERROR("Startup workitem scheduler: error: %d\n", rc);
387 goto cleanup_deregister;
388 }
389
390 rc = cfs_crypto_register();
391 if (rc) {
392 CERROR("cfs_crypto_register: error %d\n", rc);
393 goto cleanup_wi;
394 }
395
396 insert_debugfs();
397
398 CDEBUG(D_OTHER, "portals setup OK\n");
399 return 0;
400 cleanup_wi:
401 cfs_wi_shutdown();
402 cleanup_deregister:
403 misc_deregister(&libcfs_dev);
404 cleanup_cpu:
405 cfs_cpu_fini();
406 cleanup_debug:
407 libcfs_debug_cleanup();
408 return rc;
409 }
410
411 static void exit_libcfs_module(void)
412 {
413 int rc;
414
415 remove_debugfs();
416
417 if (cfs_sched_rehash != NULL) {
418 cfs_wi_sched_destroy(cfs_sched_rehash);
419 cfs_sched_rehash = NULL;
420 }
421
422 cfs_crypto_unregister();
423 cfs_wi_shutdown();
424
425 misc_deregister(&libcfs_dev);
426
427 cfs_cpu_fini();
428
429 rc = libcfs_debug_cleanup();
430 if (rc)
431 pr_err("LustreError: libcfs_debug_cleanup: %d\n", rc);
432
433 libcfs_arch_cleanup();
434 }
435
436 static int proc_call_handler(void *data, int write, loff_t *ppos,
437 void __user *buffer, size_t *lenp,
438 int (*handler)(void *data, int write,
439 loff_t pos, void __user *buffer, int len))
440 {
441 int rc = handler(data, write, *ppos, buffer, *lenp);
442
443 if (rc < 0)
444 return rc;
445
446 if (write) {
447 *ppos += *lenp;
448 } else {
449 *lenp = rc;
450 *ppos += rc;
451 }
452 return 0;
453 }
454
455 static int __proc_dobitmasks(void *data, int write,
456 loff_t pos, void __user *buffer, int nob)
457 {
458 const int tmpstrlen = 512;
459 char *tmpstr;
460 int rc;
461 unsigned int *mask = data;
462 int is_subsys = (mask == &libcfs_subsystem_debug) ? 1 : 0;
463 int is_printk = (mask == &libcfs_printk) ? 1 : 0;
464
465 rc = cfs_trace_allocate_string_buffer(&tmpstr, tmpstrlen);
466 if (rc < 0)
467 return rc;
468
469 if (!write) {
470 libcfs_debug_mask2str(tmpstr, tmpstrlen, *mask, is_subsys);
471 rc = strlen(tmpstr);
472
473 if (pos >= rc) {
474 rc = 0;
475 } else {
476 rc = cfs_trace_copyout_string(buffer, nob,
477 tmpstr + pos, "\n");
478 }
479 } else {
480 rc = cfs_trace_copyin_string(tmpstr, tmpstrlen, buffer, nob);
481 if (rc < 0) {
482 cfs_trace_free_string_buffer(tmpstr, tmpstrlen);
483 return rc;
484 }
485
486 rc = libcfs_debug_str2mask(mask, tmpstr, is_subsys);
487 /* Always print LBUG/LASSERT to console, so keep this mask */
488 if (is_printk)
489 *mask |= D_EMERG;
490 }
491
492 cfs_trace_free_string_buffer(tmpstr, tmpstrlen);
493 return rc;
494 }
495
496 static int proc_dobitmasks(struct ctl_table *table, int write,
497 void __user *buffer, size_t *lenp, loff_t *ppos)
498 {
499 return proc_call_handler(table->data, write, ppos, buffer, lenp,
500 __proc_dobitmasks);
501 }
502
503 static int __proc_dump_kernel(void *data, int write,
504 loff_t pos, void __user *buffer, int nob)
505 {
506 if (!write)
507 return 0;
508
509 return cfs_trace_dump_debug_buffer_usrstr(buffer, nob);
510 }
511
512 static int proc_dump_kernel(struct ctl_table *table, int write,
513 void __user *buffer, size_t *lenp, loff_t *ppos)
514 {
515 return proc_call_handler(table->data, write, ppos, buffer, lenp,
516 __proc_dump_kernel);
517 }
518
519 static int __proc_daemon_file(void *data, int write,
520 loff_t pos, void __user *buffer, int nob)
521 {
522 if (!write) {
523 int len = strlen(cfs_tracefile);
524
525 if (pos >= len)
526 return 0;
527
528 return cfs_trace_copyout_string(buffer, nob,
529 cfs_tracefile + pos, "\n");
530 }
531
532 return cfs_trace_daemon_command_usrstr(buffer, nob);
533 }
534
535 static int proc_daemon_file(struct ctl_table *table, int write,
536 void __user *buffer, size_t *lenp, loff_t *ppos)
537 {
538 return proc_call_handler(table->data, write, ppos, buffer, lenp,
539 __proc_daemon_file);
540 }
541
542 static int libcfs_force_lbug(struct ctl_table *table, int write,
543 void __user *buffer,
544 size_t *lenp, loff_t *ppos)
545 {
546 if (write)
547 LBUG();
548 return 0;
549 }
550
551 static int proc_fail_loc(struct ctl_table *table, int write,
552 void __user *buffer,
553 size_t *lenp, loff_t *ppos)
554 {
555 int rc;
556 long old_fail_loc = cfs_fail_loc;
557
558 rc = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
559 if (old_fail_loc != cfs_fail_loc)
560 wake_up(&cfs_race_waitq);
561 return rc;
562 }
563
564 static int __proc_cpt_table(void *data, int write,
565 loff_t pos, void __user *buffer, int nob)
566 {
567 char *buf = NULL;
568 int len = 4096;
569 int rc = 0;
570
571 if (write)
572 return -EPERM;
573
574 LASSERT(cfs_cpt_table != NULL);
575
576 while (1) {
577 LIBCFS_ALLOC(buf, len);
578 if (buf == NULL)
579 return -ENOMEM;
580
581 rc = cfs_cpt_table_print(cfs_cpt_table, buf, len);
582 if (rc >= 0)
583 break;
584
585 if (rc == -EFBIG) {
586 LIBCFS_FREE(buf, len);
587 len <<= 1;
588 continue;
589 }
590 goto out;
591 }
592
593 if (pos >= rc) {
594 rc = 0;
595 goto out;
596 }
597
598 rc = cfs_trace_copyout_string(buffer, nob, buf + pos, NULL);
599 out:
600 if (buf != NULL)
601 LIBCFS_FREE(buf, len);
602 return rc;
603 }
604
605 static int proc_cpt_table(struct ctl_table *table, int write,
606 void __user *buffer, size_t *lenp, loff_t *ppos)
607 {
608 return proc_call_handler(table->data, write, ppos, buffer, lenp,
609 __proc_cpt_table);
610 }
611
612 static struct ctl_table lnet_table[] = {
613 /*
614 * NB No .strategy entries have been provided since sysctl(8) prefers
615 * to go via /proc for portability.
616 */
617 {
618 .procname = "debug",
619 .data = &libcfs_debug,
620 .maxlen = sizeof(int),
621 .mode = 0644,
622 .proc_handler = &proc_dobitmasks,
623 },
624 {
625 .procname = "subsystem_debug",
626 .data = &libcfs_subsystem_debug,
627 .maxlen = sizeof(int),
628 .mode = 0644,
629 .proc_handler = &proc_dobitmasks,
630 },
631 {
632 .procname = "printk",
633 .data = &libcfs_printk,
634 .maxlen = sizeof(int),
635 .mode = 0644,
636 .proc_handler = &proc_dobitmasks,
637 },
638 {
639 .procname = "cpu_partition_table",
640 .maxlen = 128,
641 .mode = 0444,
642 .proc_handler = &proc_cpt_table,
643 },
644
645 {
646 .procname = "upcall",
647 .data = lnet_upcall,
648 .maxlen = sizeof(lnet_upcall),
649 .mode = 0644,
650 .proc_handler = &proc_dostring,
651 },
652 {
653 .procname = "debug_log_upcall",
654 .data = lnet_debug_log_upcall,
655 .maxlen = sizeof(lnet_debug_log_upcall),
656 .mode = 0644,
657 .proc_handler = &proc_dostring,
658 },
659 {
660 .procname = "catastrophe",
661 .data = &libcfs_catastrophe,
662 .maxlen = sizeof(int),
663 .mode = 0444,
664 .proc_handler = &proc_dointvec,
665 },
666 {
667 .procname = "dump_kernel",
668 .maxlen = 256,
669 .mode = 0200,
670 .proc_handler = &proc_dump_kernel,
671 },
672 {
673 .procname = "daemon_file",
674 .mode = 0644,
675 .maxlen = 256,
676 .proc_handler = &proc_daemon_file,
677 },
678 {
679 .procname = "force_lbug",
680 .data = NULL,
681 .maxlen = 0,
682 .mode = 0200,
683 .proc_handler = &libcfs_force_lbug
684 },
685 {
686 .procname = "fail_loc",
687 .data = &cfs_fail_loc,
688 .maxlen = sizeof(cfs_fail_loc),
689 .mode = 0644,
690 .proc_handler = &proc_fail_loc
691 },
692 {
693 .procname = "fail_val",
694 .data = &cfs_fail_val,
695 .maxlen = sizeof(int),
696 .mode = 0644,
697 .proc_handler = &proc_dointvec
698 },
699 {
700 }
701 };
702
703 struct lnet_debugfs_symlink_def {
704 char *name;
705 char *target;
706 };
707
708 static const struct lnet_debugfs_symlink_def lnet_debugfs_symlinks[] = {
709 { "console_ratelimit",
710 "/sys/module/libcfs/parameters/libcfs_console_ratelimit"},
711 { "debug_path",
712 "/sys/module/libcfs/parameters/libcfs_debug_file_path"},
713 { "panic_on_lbug",
714 "/sys/module/libcfs/parameters/libcfs_panic_on_lbug"},
715 { "libcfs_console_backoff",
716 "/sys/module/libcfs/parameters/libcfs_console_backoff"},
717 { "debug_mb",
718 "/sys/module/libcfs/parameters/libcfs_debug_mb"},
719 { "console_min_delay_centisecs",
720 "/sys/module/libcfs/parameters/libcfs_console_min_delay"},
721 { "console_max_delay_centisecs",
722 "/sys/module/libcfs/parameters/libcfs_console_max_delay"},
723 {},
724 };
725
726 static ssize_t lnet_debugfs_read(struct file *filp, char __user *buf,
727 size_t count, loff_t *ppos)
728 {
729 struct ctl_table *table = filp->private_data;
730 int error;
731
732 error = table->proc_handler(table, 0, (void __user *)buf, &count, ppos);
733 if (!error)
734 error = count;
735
736 return error;
737 }
738
739 static ssize_t lnet_debugfs_write(struct file *filp, const char __user *buf,
740 size_t count, loff_t *ppos)
741 {
742 struct ctl_table *table = filp->private_data;
743 int error;
744
745 error = table->proc_handler(table, 1, (void __user *)buf, &count, ppos);
746 if (!error)
747 error = count;
748
749 return error;
750 }
751
752 static const struct file_operations lnet_debugfs_file_operations = {
753 .open = simple_open,
754 .read = lnet_debugfs_read,
755 .write = lnet_debugfs_write,
756 .llseek = default_llseek,
757 };
758
759 static void insert_debugfs(void)
760 {
761 struct ctl_table *table;
762 struct dentry *entry;
763 const struct lnet_debugfs_symlink_def *symlinks;
764
765 if (lnet_debugfs_root == NULL)
766 lnet_debugfs_root = debugfs_create_dir("lnet", NULL);
767
768 /* Even if we cannot create, just ignore it altogether) */
769 if (IS_ERR_OR_NULL(lnet_debugfs_root))
770 return;
771
772 for (table = lnet_table; table->procname; table++)
773 entry = debugfs_create_file(table->procname, table->mode,
774 lnet_debugfs_root, table,
775 &lnet_debugfs_file_operations);
776
777 for (symlinks = lnet_debugfs_symlinks; symlinks->name; symlinks++)
778 entry = debugfs_create_symlink(symlinks->name,
779 lnet_debugfs_root,
780 symlinks->target);
781
782 }
783
784 static void remove_debugfs(void)
785 {
786 if (lnet_debugfs_root != NULL)
787 debugfs_remove_recursive(lnet_debugfs_root);
788
789 lnet_debugfs_root = NULL;
790 }
791
792 MODULE_VERSION("1.0.0");
793
794 module_init(init_libcfs_module);
795 module_exit(exit_libcfs_module);