Whamcloud - gitweb
7c0cafc7817f363619c91730eed88b85dc42de29
[fs/lustre-release.git] / lustre / portals / libcfs / module.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
5  *
6  *   This file is part of Lustre, http://www.lustre.org.
7  *
8  *   Lustre is free software; you can redistribute it and/or
9  *   modify it under the terms of version 2 of the GNU General Public
10  *   License as published by the Free Software Foundation.
11  *
12  *   Lustre is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with Lustre; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21
22 #ifndef EXPORT_SYMTAB
23 # define EXPORT_SYMTAB
24 #endif
25 #define DEBUG_SUBSYSTEM S_PORTALS
26
27 #include <linux/config.h>
28 #include <linux/module.h>
29 #include <linux/kernel.h>
30 #include <linux/mm.h>
31 #include <linux/string.h>
32 #include <linux/stat.h>
33 #include <linux/init.h>
34 #include <linux/errno.h>
35 #include <linux/smp_lock.h>
36 #include <linux/unistd.h>
37
38 #include <asm/system.h>
39 #include <asm/uaccess.h>
40
41 #include <linux/fs.h>
42 #include <linux/stat.h>
43 #include <asm/uaccess.h>
44 #include <asm/segment.h>
45 #include <linux/miscdevice.h>
46
47 #include <portals/lib-p30.h>
48 #include <portals/p30.h>
49 #include <linux/kp30.h>
50 #include <linux/portals_compat25.h>
51
52 #define PORTAL_MINOR 240
53
54 extern void (kping_client)(struct portal_ioctl_data *);
55
56 struct nal_cmd_handler {
57         nal_cmd_handler_t nch_handler;
58         void * nch_private;
59 };
60
61 static struct nal_cmd_handler nal_cmd[NAL_MAX_NR + 1];
62 struct semaphore nal_cmd_sem;
63
64 #ifdef PORTAL_DEBUG
65 void kportal_assertion_failed(char *expr, char *file, const char *func,
66                               const int line)
67 {
68         portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK,
69                           "ASSERTION(%s) failed\n", expr);
70         LBUG_WITH_LOC(file, func, line);
71 }
72 #endif
73
74 void
75 kportal_daemonize (char *str) 
76 {
77 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,63))
78         daemonize(str);
79 #else
80         daemonize();
81         snprintf (current->comm, sizeof (current->comm), "%s", str);
82 #endif
83 }
84
85 void
86 kportal_blockallsigs ()
87 {
88         unsigned long  flags;
89
90         SIGNAL_MASK_LOCK(current, flags);
91         sigfillset(&current->blocked);
92         RECALC_SIGPENDING;
93         SIGNAL_MASK_UNLOCK(current, flags);
94 }
95
96 /* called when opening /dev/device */
97 static int kportal_psdev_open(struct inode * inode, struct file * file)
98 {
99         ENTRY;
100
101         if (!inode)
102                 RETURN(-EINVAL);
103         PORTAL_MODULE_USE;
104         RETURN(0);
105 }
106
107 /* called when closing /dev/device */
108 static int kportal_psdev_release(struct inode * inode, struct file * file)
109 {
110         ENTRY;
111
112         if (!inode)
113                 RETURN(-EINVAL);
114
115         PORTAL_MODULE_UNUSE;
116         RETURN(0);
117 }
118
119 static inline void freedata(void *data, int len)
120 {
121         PORTAL_FREE(data, len);
122 }
123
124 static int
125 kportal_add_route(int gateway_nalid, ptl_nid_t gateway_nid, 
126                   ptl_nid_t lo_nid, ptl_nid_t hi_nid)
127 {
128         int rc;
129         kpr_control_interface_t *ci;
130
131         ci = (kpr_control_interface_t *) PORTAL_SYMBOL_GET (kpr_control_interface);
132         if (ci == NULL)
133                 return (-ENODEV);
134
135         rc = ci->kprci_add_route (gateway_nalid, gateway_nid, lo_nid, hi_nid);
136
137         PORTAL_SYMBOL_PUT(kpr_control_interface);
138         return (rc);
139 }
140
141 static int
142 kportal_del_route(int gw_nalid, ptl_nid_t gw_nid, 
143                   ptl_nid_t lo, ptl_nid_t hi)
144 {
145         int rc;
146         kpr_control_interface_t *ci;
147
148         ci = (kpr_control_interface_t *)PORTAL_SYMBOL_GET(kpr_control_interface);
149         if (ci == NULL)
150                 return (-ENODEV);
151
152         rc = ci->kprci_del_route (gw_nalid, gw_nid, lo, hi);
153
154         PORTAL_SYMBOL_PUT(kpr_control_interface);
155         return (rc);
156 }
157
158 static int
159 kportal_notify_router (int gw_nalid, ptl_nid_t gw_nid,
160                        int alive, time_t when)
161 {
162         int rc;
163         kpr_control_interface_t *ci;
164
165         /* No error if router not preset.  Sysadmin is allowed to notify
166          * _everywhere_ when a NID boots or crashes, even if they know
167          * nothing of the peer. */
168         ci = (kpr_control_interface_t *)PORTAL_SYMBOL_GET(kpr_control_interface);
169         if (ci == NULL)
170                 return (0);
171
172         rc = ci->kprci_notify (gw_nalid, gw_nid, alive, when);
173
174         PORTAL_SYMBOL_PUT(kpr_control_interface);
175         return (rc);
176 }
177
178 static int
179 kportal_get_route(int index, __u32 *gateway_nalidp, ptl_nid_t *gateway_nidp,
180                   ptl_nid_t *lo_nidp, ptl_nid_t *hi_nidp, int *alivep)
181 {
182         int       gateway_nalid;
183         ptl_nid_t gateway_nid;
184         ptl_nid_t lo_nid;
185         ptl_nid_t hi_nid;
186         int       alive;
187         int       rc;
188         kpr_control_interface_t *ci;
189
190         ci = (kpr_control_interface_t *) PORTAL_SYMBOL_GET(kpr_control_interface);
191         if (ci == NULL)
192                 return (-ENODEV);
193
194         rc = ci->kprci_get_route(index, &gateway_nalid, &gateway_nid,
195                                  &lo_nid, &hi_nid, &alive);
196
197         if (rc == 0) {
198                 CDEBUG(D_IOCTL, "got route [%d] %d "LPX64":"LPX64" - "LPX64", %s\n",
199                        index, gateway_nalid, gateway_nid, lo_nid, hi_nid,
200                        alive ? "up" : "down");
201
202                 *gateway_nalidp = (__u32)gateway_nalid;
203                 *gateway_nidp   = gateway_nid;
204                 *lo_nidp        = lo_nid;
205                 *hi_nidp        = hi_nid;
206                 *alivep         = alive;
207         }
208
209         PORTAL_SYMBOL_PUT (kpr_control_interface);
210         return (rc);
211 }
212
213 static int 
214 kportal_router_cmd(struct portals_cfg *pcfg, void * private)
215 {
216         int err = -EINVAL;
217         ENTRY;
218
219         switch(pcfg->pcfg_command) {
220         default:
221                 CDEBUG(D_IOCTL, "Inappropriate cmd: %d\n", pcfg->pcfg_command);
222                 break;
223                 
224         case NAL_CMD_ADD_ROUTE:
225                 CDEBUG(D_IOCTL, "Adding route: [%d] "LPU64" : "LPU64" - "LPU64"\n",
226                        pcfg->pcfg_nal, pcfg->pcfg_nid, 
227                        pcfg->pcfg_nid2, pcfg->pcfg_nid3);
228                 err = kportal_add_route(pcfg->pcfg_gw_nal, pcfg->pcfg_nid,
229                                         pcfg->pcfg_nid2, pcfg->pcfg_nid3);
230                 break;
231
232         case NAL_CMD_DEL_ROUTE:
233                 CDEBUG (D_IOCTL, "Removing routes via [%d] "LPU64" : "LPU64" - "LPU64"\n",
234                         pcfg->pcfg_gw_nal, pcfg->pcfg_nid, 
235                         pcfg->pcfg_nid2, pcfg->pcfg_nid3);
236                 err = kportal_del_route (pcfg->pcfg_gw_nal, pcfg->pcfg_nid,
237                                          pcfg->pcfg_nid2, pcfg->pcfg_nid3);
238                 break;
239
240         case NAL_CMD_NOTIFY_ROUTER: {
241                 CDEBUG (D_IOCTL, "Notifying peer [%d] "LPU64" %s @ %ld\n",
242                         pcfg->pcfg_gw_nal, pcfg->pcfg_nid,
243                         pcfg->pcfg_flags ? "Enabling" : "Disabling",
244                         (time_t)pcfg->pcfg_nid3);
245                 
246                 err = kportal_notify_router (pcfg->pcfg_gw_nal, pcfg->pcfg_nid,
247                                              pcfg->pcfg_flags, 
248                                              (time_t)pcfg->pcfg_nid3);
249                 break;
250         }
251                 
252         case NAL_CMD_GET_ROUTE:
253                 CDEBUG (D_IOCTL, "Getting route [%d]\n", pcfg->pcfg_count);
254                 err = kportal_get_route(pcfg->pcfg_count, &pcfg->pcfg_gw_nal,
255                                         &pcfg->pcfg_nid, 
256                                         &pcfg->pcfg_nid2, &pcfg->pcfg_nid3,
257                                         &pcfg->pcfg_flags);
258                 break;
259         }
260         RETURN(err);
261 }
262
263 int
264 kportal_nal_cmd(struct portals_cfg *pcfg)
265 {
266         __u32 nal = pcfg->pcfg_nal;
267         int rc = -EINVAL;
268
269         ENTRY;
270
271         down(&nal_cmd_sem);
272         if (nal > 0 && nal <= NAL_MAX_NR && nal_cmd[nal].nch_handler) {
273                 CDEBUG(D_IOCTL, "calling handler nal: %d, cmd: %d\n", nal, 
274                        pcfg->pcfg_command);
275                 rc = nal_cmd[nal].nch_handler(pcfg, nal_cmd[nal].nch_private);
276         }
277         up(&nal_cmd_sem);
278         RETURN(rc);
279 }
280
281 ptl_handle_ni_t *
282 kportal_get_ni (int nal)
283 {
284
285         switch (nal)
286         {
287         case QSWNAL:
288                 return (PORTAL_SYMBOL_GET(kqswnal_ni));
289         case SOCKNAL:
290                 return (PORTAL_SYMBOL_GET(ksocknal_ni));
291         case TOENAL:
292                 return  (PORTAL_SYMBOL_GET(ktoenal_ni));
293         case GMNAL:
294                 return  (PORTAL_SYMBOL_GET(kgmnal_ni));
295         case IBNAL:
296                 return  (PORTAL_SYMBOL_GET(kibnal_ni));
297         case TCPNAL:
298                 /* userspace NAL */
299                 return (NULL);
300         case SCIMACNAL:
301                 return  (PORTAL_SYMBOL_GET(kscimacnal_ni));
302         default:
303                 /* A warning to a naive caller */
304                 CERROR ("unknown nal: %d\n", nal);
305                 return (NULL);
306         }
307 }
308
309 void
310 kportal_put_ni (int nal)
311 {
312
313         switch (nal)
314         {
315         case QSWNAL:
316                 PORTAL_SYMBOL_PUT(kqswnal_ni);
317                 break;
318         case SOCKNAL:
319                 PORTAL_SYMBOL_PUT(ksocknal_ni);
320                 break;
321         case TOENAL:
322                 PORTAL_SYMBOL_PUT(ktoenal_ni);
323                 break;
324         case GMNAL:
325                 PORTAL_SYMBOL_PUT(kgmnal_ni);
326                 break;
327         case IBNAL:
328                 PORTAL_SYMBOL_PUT(kibnal_ni);
329                 break;
330         case TCPNAL:
331                 /* A lesson to a malicious caller */
332                 LBUG ();
333         case SCIMACNAL:
334                 PORTAL_SYMBOL_PUT(kscimacnal_ni);
335                 break;
336         default:
337                 CERROR ("unknown nal: %d\n", nal);
338         }
339 }
340
341 int
342 kportal_nal_register(int nal, nal_cmd_handler_t handler, void * private)
343 {
344         int rc = 0;
345
346         CDEBUG(D_IOCTL, "Register NAL %d, handler: %p\n", nal, handler);
347
348         if (nal > 0  && nal <= NAL_MAX_NR) {
349                 down(&nal_cmd_sem);
350                 if (nal_cmd[nal].nch_handler != NULL)
351                         rc = -EBUSY;
352                 else {
353                         nal_cmd[nal].nch_handler = handler;
354                         nal_cmd[nal].nch_private = private;
355                 }
356                 up(&nal_cmd_sem);
357         }
358         return rc;
359 }
360
361 int
362 kportal_nal_unregister(int nal)
363 {
364         int rc = 0;
365
366         CDEBUG(D_IOCTL, "Unregister NAL %d\n", nal);
367
368         if (nal > 0  && nal <= NAL_MAX_NR) {
369                 down(&nal_cmd_sem);
370                 nal_cmd[nal].nch_handler = NULL;
371                 nal_cmd[nal].nch_private = NULL;
372                 up(&nal_cmd_sem);
373         }
374         return rc;
375 }
376
377
378 static int kportal_ioctl(struct inode *inode, struct file *file,
379                          unsigned int cmd, unsigned long arg)
380 {
381         int err = 0;
382         char buf[1024];
383         struct portal_ioctl_data *data;
384         char str[PTL_NALFMT_SIZE];
385
386         ENTRY;
387
388         if (current->fsuid != 0)
389                 RETURN(err = -EACCES);
390
391         if ( _IOC_TYPE(cmd) != IOC_PORTAL_TYPE ||
392              _IOC_NR(cmd) < IOC_PORTAL_MIN_NR  ||
393              _IOC_NR(cmd) > IOC_PORTAL_MAX_NR ) {
394                 CDEBUG(D_IOCTL, "invalid ioctl ( type %d, nr %d, size %d )\n",
395                                 _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd));
396                 RETURN(-EINVAL);
397         }
398
399         if (portal_ioctl_getdata(buf, buf + 800, (void *)arg)) {
400                 CERROR("PORTALS ioctl: data error\n");
401                 RETURN(-EINVAL);
402         }
403
404         data = (struct portal_ioctl_data *)buf;
405
406         switch (cmd) {
407         case IOC_PORTAL_SET_DAEMON: 
408                 RETURN (portals_debug_set_daemon ( 
409                                         (unsigned int) data->ioc_count,
410                                         (unsigned int) data->ioc_inllen1,
411                                         (char *) data->ioc_inlbuf1,
412                                         (unsigned int) data->ioc_misc)); 
413         case IOC_PORTAL_GET_DEBUG: {
414                 __s32 size = portals_debug_copy_to_user(data->ioc_pbuf1,
415                                                         data->ioc_plen1);
416
417                 if (size < 0)
418                         RETURN(size);
419
420                 data->ioc_size = size;
421                 err = copy_to_user((char *)arg, data, sizeof(*data));
422                 RETURN(err);
423         }
424         case IOC_PORTAL_CLEAR_DEBUG:
425                 portals_debug_clear_buffer();
426                 RETURN(0);
427         case IOC_PORTAL_PANIC:
428                 if (!capable (CAP_SYS_BOOT))
429                         RETURN (-EPERM);
430                 panic("debugctl-invoked panic");
431                 RETURN(0);
432         case IOC_PORTAL_MARK_DEBUG:
433                 if (data->ioc_inlbuf1 == NULL ||
434                     data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0')
435                         RETURN(-EINVAL);
436                 portals_debug_mark_buffer(data->ioc_inlbuf1);
437                 RETURN(0);
438         case IOC_PORTAL_PING: {
439                 void (*ping)(struct portal_ioctl_data *);
440
441                 CDEBUG(D_IOCTL, "doing %d pings to nid "LPX64" (%s)\n",
442                        data->ioc_count, data->ioc_nid,
443                        portals_nid2str(data->ioc_nal, data->ioc_nid, str));
444                 ping = PORTAL_SYMBOL_GET(kping_client);
445                 if (!ping)
446                         CERROR("PORTAL_SYMBOL_GET failed\n");
447                 else {
448                         ping(data);
449                         PORTAL_SYMBOL_PUT(kping_client);
450                 }
451                 RETURN(0);
452         }
453
454         case IOC_PORTAL_GET_NID: {
455                 const ptl_handle_ni_t *nip;
456                 ptl_process_id_t       pid;
457
458                 CDEBUG (D_IOCTL, "Getting nid for nal [%d]\n", data->ioc_nal);
459
460                 nip = kportal_get_ni (data->ioc_nal);
461                 if (nip == NULL)
462                         RETURN (-EINVAL);
463
464                 err = PtlGetId (*nip, &pid);
465                 LASSERT (err == PTL_OK);
466                 kportal_put_ni (data->ioc_nal);
467
468                 data->ioc_nid = pid.nid;
469                 if (copy_to_user ((char *)arg, data, sizeof (*data)))
470                         err = -EFAULT;
471                 break;
472         }
473
474         case IOC_PORTAL_NAL_CMD: {
475                 struct portals_cfg pcfg;
476
477                 LASSERT (data->ioc_plen1 == sizeof(pcfg));
478                 err = copy_from_user(&pcfg, (void *)data->ioc_pbuf1, 
479                                      sizeof(pcfg));
480                 if ( err ) {
481                         EXIT;
482                         return err;
483                 }
484
485                 CDEBUG (D_IOCTL, "nal command nal %d cmd %d\n", pcfg.pcfg_nal,
486                         pcfg.pcfg_command);
487                 err = kportal_nal_cmd(&pcfg);
488                 if (err == 0) {
489                         if (copy_to_user((char *)data->ioc_pbuf1, &pcfg, 
490                                          sizeof (pcfg)))
491                                 err = -EFAULT;
492                         if (copy_to_user((char *)arg, data, sizeof (*data)))
493                                 err = -EFAULT;
494                 }
495                 break;
496         }
497         case IOC_PORTAL_FAIL_NID: {
498                 const ptl_handle_ni_t *nip;
499
500                 CDEBUG (D_IOCTL, "fail nid: [%d] "LPU64" count %d\n",
501                         data->ioc_nal, data->ioc_nid, data->ioc_count);
502
503                 nip = kportal_get_ni (data->ioc_nal);
504                 if (nip == NULL)
505                         return (-EINVAL);
506
507                 err = PtlFailNid (*nip, data->ioc_nid, data->ioc_count);
508                 kportal_put_ni (data->ioc_nal);
509                 break;
510         }
511 #if LWT_SUPPORT
512         case IOC_PORTAL_LWT_CONTROL: 
513                 err = lwt_control (data->ioc_flags, data->ioc_misc);
514                 break;
515                 
516         case IOC_PORTAL_LWT_SNAPSHOT:
517                 err = lwt_snapshot (&data->ioc_count, &data->ioc_misc,
518                                     data->ioc_pbuf1, data->ioc_plen1);
519                 if (err == 0 &&
520                     copy_to_user((char *)arg, data, sizeof (*data)))
521                         err = -EFAULT;
522                 break;
523                 
524         case IOC_PORTAL_LWT_LOOKUP_STRING:
525                 err = lwt_lookup_string (&data->ioc_count, data->ioc_pbuf1,
526                                          data->ioc_pbuf2, data->ioc_plen2);
527                 if (err == 0 &&
528                     copy_to_user((char *)arg, data, sizeof (*data)))
529                         err = -EFAULT;
530                 break;
531 #endif                        
532         default:
533                 err = -EINVAL;
534                 break;
535         }
536
537         RETURN(err);
538 }
539
540
541 static struct file_operations portalsdev_fops = {
542         ioctl:   kportal_ioctl,
543         open:    kportal_psdev_open,
544         release: kportal_psdev_release
545 };
546
547
548 static struct miscdevice portal_dev = {
549         PORTAL_MINOR,
550         "portals",
551         &portalsdev_fops
552 };
553
554 extern int insert_proc(void);
555 extern void remove_proc(void);
556 MODULE_AUTHOR("Peter J. Braam <braam@clusterfs.com>");
557 MODULE_DESCRIPTION("Portals v3.1");
558 MODULE_LICENSE("GPL");
559
560 static int init_kportals_module(void)
561 {
562         int rc;
563
564         rc = portals_debug_init(5 * 1024 * 1024);
565         if (rc < 0) {
566                 printk(KERN_ERR "LustreError: portals_debug_init: %d\n", rc);
567                 return (rc);
568         }
569
570 #if LWT_SUPPORT
571         rc = lwt_init();
572         if (rc != 0) {
573                 CERROR("lwt_init: error %d\n", rc);
574                 goto cleanup_debug;
575         }
576 #endif
577         sema_init(&nal_cmd_sem, 1);
578
579         rc = misc_register(&portal_dev);
580         if (rc) {
581                 CERROR("misc_register: error %d\n", rc);
582                 goto cleanup_lwt;
583         }
584
585         rc = PtlInit();
586         if (rc) {
587                 CERROR("PtlInit: error %d\n", rc);
588                 goto cleanup_deregister;
589         }
590
591         rc = insert_proc();
592         if (rc) {
593                 CERROR("insert_proc: error %d\n", rc);
594                 goto cleanup_fini;
595         }
596
597         rc = kportal_nal_register(ROUTER, kportal_router_cmd, NULL);
598         if (rc) {
599                 CERROR("kportal_nal_registre: ROUTER error %d\n", rc);
600                 goto cleanup_proc;
601         }
602
603         CDEBUG (D_OTHER, "portals setup OK\n");
604         return (0);
605
606  cleanup_proc:
607         remove_proc();
608  cleanup_fini:
609         PtlFini();
610  cleanup_deregister:
611         misc_deregister(&portal_dev);
612  cleanup_lwt:
613 #if LWT_SUPPORT
614         lwt_fini();
615 #endif
616  cleanup_debug:
617         portals_debug_cleanup();
618         return rc;
619 }
620
621 static void exit_kportals_module(void)
622 {
623         int rc;
624
625         kportal_nal_unregister(ROUTER);
626         remove_proc();
627         PtlFini();
628
629         CDEBUG(D_MALLOC, "before Portals cleanup: kmem %d\n",
630                atomic_read(&portal_kmemory));
631
632
633         rc = misc_deregister(&portal_dev);
634         if (rc)
635                 CERROR("misc_deregister error %d\n", rc);
636
637 #if LWT_SUPPORT
638         lwt_fini();
639 #endif
640
641         if (atomic_read(&portal_kmemory) != 0)
642                 CERROR("Portals memory leaked: %d bytes\n",
643                        atomic_read(&portal_kmemory));
644
645         rc = portals_debug_cleanup();
646         if (rc)
647                 printk(KERN_ERR "LustreError: portals_debug_cleanup: %d\n", rc);
648 }
649
650 EXPORT_SYMBOL(lib_dispatch);
651 EXPORT_SYMBOL(PtlMEAttach);
652 EXPORT_SYMBOL(PtlMEInsert);
653 EXPORT_SYMBOL(PtlMEUnlink);
654 EXPORT_SYMBOL(PtlEQAlloc);
655 EXPORT_SYMBOL(PtlMDAttach);
656 EXPORT_SYMBOL(PtlMDUnlink);
657 EXPORT_SYMBOL(PtlNIInit);
658 EXPORT_SYMBOL(PtlNIFini);
659 EXPORT_SYMBOL(PtlNIDebug);
660 EXPORT_SYMBOL(PtlInit);
661 EXPORT_SYMBOL(PtlFini);
662 EXPORT_SYMBOL(PtlPut);
663 EXPORT_SYMBOL(PtlGet);
664 EXPORT_SYMBOL(ptl_err_str);
665 EXPORT_SYMBOL(portal_subsystem_debug);
666 EXPORT_SYMBOL(portal_debug);
667 EXPORT_SYMBOL(portal_stack);
668 EXPORT_SYMBOL(portal_printk);
669 EXPORT_SYMBOL(portal_cerror);
670 EXPORT_SYMBOL(PtlEQWait);
671 EXPORT_SYMBOL(PtlEQFree);
672 EXPORT_SYMBOL(PtlEQGet);
673 EXPORT_SYMBOL(PtlGetId);
674 EXPORT_SYMBOL(PtlMDBind);
675 EXPORT_SYMBOL(lib_iov_nob);
676 EXPORT_SYMBOL(lib_copy_iov2buf);
677 EXPORT_SYMBOL(lib_copy_buf2iov);
678 EXPORT_SYMBOL(lib_kiov_nob);
679 EXPORT_SYMBOL(lib_copy_kiov2buf);
680 EXPORT_SYMBOL(lib_copy_buf2kiov);
681 EXPORT_SYMBOL(lib_finalize);
682 EXPORT_SYMBOL(lib_parse);
683 EXPORT_SYMBOL(lib_fake_reply_msg);
684 EXPORT_SYMBOL(lib_init);
685 EXPORT_SYMBOL(lib_fini);
686 EXPORT_SYMBOL(portal_kmemory);
687 EXPORT_SYMBOL(kportal_daemonize);
688 EXPORT_SYMBOL(kportal_blockallsigs);
689 EXPORT_SYMBOL(kportal_nal_register);
690 EXPORT_SYMBOL(kportal_nal_unregister);
691 EXPORT_SYMBOL(kportal_assertion_failed);
692 EXPORT_SYMBOL(dispatch_name);
693 EXPORT_SYMBOL(kportal_get_ni);
694 EXPORT_SYMBOL(kportal_put_ni);
695 EXPORT_SYMBOL(kportal_nal_cmd);
696
697 module_init(init_kportals_module);
698 module_exit (exit_kportals_module);