Whamcloud - gitweb
b=2353
[fs/lustre-release.git] / lustre / obdclass / class_obd.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Object Devices Class Driver
5  *
6  *  Copyright (C) 2001-2003 Cluster File Systems, Inc.
7  *
8  *   This file is part of Lustre, http://www.lustre.org.
9  *
10  *   Lustre is free software; you can redistribute it and/or
11  *   modify it under the terms of version 2 of the GNU General Public
12  *   License as published by the Free Software Foundation.
13  *
14  *   Lustre is distributed in the hope that it will be useful,
15  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *   GNU General Public License for more details.
18  *
19  *   You should have received a copy of the GNU General Public License
20  *   along with Lustre; if not, write to the Free Software
21  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *
23  * These are the only exported functions, they provide some generic
24  * infrastructure for managing object devices
25  */
26
27 #define DEBUG_SUBSYSTEM S_CLASS
28 #ifndef EXPORT_SYMTAB
29 # define EXPORT_SYMTAB
30 #endif
31 #ifdef __KERNEL__
32 #include <linux/config.h> /* for CONFIG_PROC_FS */
33 #include <linux/module.h>
34 #include <linux/errno.h>
35 #include <linux/kernel.h>
36 #include <linux/major.h>
37 #include <linux/sched.h>
38 #include <linux/lp.h>
39 #include <linux/slab.h>
40 #include <linux/ioport.h>
41 #include <linux/fcntl.h>
42 #include <linux/delay.h>
43 #include <linux/skbuff.h>
44 #include <linux/proc_fs.h>
45 #include <linux/fs.h>
46 #include <linux/poll.h>
47 #include <linux/init.h>
48 #include <linux/list.h>
49 #include <linux/highmem.h>
50 #include <asm/io.h>
51 #include <asm/ioctls.h>
52 #include <asm/system.h>
53 #include <asm/poll.h>
54 #include <asm/uaccess.h>
55 #include <linux/miscdevice.h>
56 #include <linux/smp_lock.h>
57 #include <linux/seq_file.h>
58 #else
59 # include <liblustre.h>
60 #endif
61
62 #include <linux/obd_support.h>
63 #include <linux/obd_class.h>
64 #include <linux/lustre_debug.h>
65 #include <linux/lprocfs_status.h>
66 #include <linux/lustre_build_version.h>
67 #include <portals/list.h>
68 #include "llog_internal.h"
69
70 struct semaphore obd_conf_sem;   /* serialize configuration commands */
71 struct obd_device obd_dev[MAX_OBD_DEVICES];
72 struct list_head obd_types;
73 atomic_t obd_memory;
74 int obd_memmax;
75
76 int proc_version;
77
78 /* The following are visible and mutable through /proc/sys/lustre/. */
79 unsigned int obd_fail_loc;
80 unsigned int obd_timeout = 100;
81 char obd_lustre_upcall[128] = "/usr/lib/lustre/lustre_upcall";
82 unsigned int obd_sync_filter; /* = 0, don't sync by default */
83
84 #ifdef __KERNEL__
85 /*  opening /dev/obd */
86 static int obd_class_open(struct inode * inode, struct file * file)
87 {
88         ENTRY;
89
90         PORTAL_MODULE_USE;
91         RETURN(0);
92 }
93
94 /*  closing /dev/obd */
95 static int obd_class_release(struct inode * inode, struct file * file)
96 {
97         ENTRY;
98
99         PORTAL_MODULE_UNUSE;
100         RETURN(0);
101 }
102 #endif
103
104 static inline void obd_data2conn(struct lustre_handle *conn,
105                                  struct obd_ioctl_data *data)
106 {
107         memset(conn, 0, sizeof *conn);
108         conn->cookie = data->ioc_cookie;
109 }
110
111 static inline void obd_conn2data(struct obd_ioctl_data *data,
112                                  struct lustre_handle *conn)
113 {
114         data->ioc_cookie = conn->cookie;
115 }
116
117 int class_resolve_dev_name(uint32_t len, char *name)
118 {
119         int rc;
120         int dev;
121
122         if (!len || !name) {
123                 CERROR("No name passed,!\n");
124                 GOTO(out, rc = -EINVAL);
125         }
126         if (name[len - 1] != 0) {
127                 CERROR("Name not nul terminated!\n");
128                 GOTO(out, rc = -EINVAL);
129         }
130
131         CDEBUG(D_IOCTL, "device name %s\n", name);
132         dev = class_name2dev(name);
133         if (dev == -1) {
134                 CDEBUG(D_IOCTL, "No device for name %s!\n", name);
135                 GOTO(out, rc = -EINVAL);
136         }
137
138         CDEBUG(D_IOCTL, "device name %s, dev %d\n", name, dev);
139         rc = dev;
140
141 out:
142         RETURN(rc);
143 }
144
145 int class_handle_ioctl(unsigned int cmd, unsigned long arg)
146 {
147         char *buf = NULL;
148         struct obd_ioctl_data *data;
149         struct portals_debug_ioctl_data *debug_data;
150         struct obd_device *obd = NULL;
151         int err = 0, len = 0, serialised = 0;
152         ENTRY;
153
154         if (current->fsuid != 0)
155                 RETURN(err = -EACCES);
156
157         if ((cmd & 0xffffff00) == ((int)'T') << 8) /* ignore all tty ioctls */
158                 RETURN(err = -ENOTTY);
159
160         /* only for debugging */
161         if (cmd == PTL_IOC_DEBUG_MASK) {
162                 debug_data = (struct portals_debug_ioctl_data*)arg;
163                 portal_subsystem_debug = debug_data->subs;
164                 portal_debug = debug_data->debug;
165                 return 0;
166         }
167
168         switch (cmd) {
169         case OBD_IOC_BRW_WRITE:
170         case OBD_IOC_BRW_READ:
171         case OBD_IOC_GETATTR:
172         case ECHO_IOC_ENQUEUE:
173         case ECHO_IOC_CANCEL:
174         case OBD_IOC_CLIENT_RECOVER:
175         case OBD_IOC_CATLOGLIST:
176         case OBD_IOC_LLOG_INFO:
177         case OBD_IOC_LLOG_PRINT:
178         case OBD_IOC_LLOG_CANCEL:
179         case OBD_IOC_LLOG_CHECK:
180         case OBD_IOC_LLOG_REMOVE:
181                 break;
182         default:
183                 down(&obd_conf_sem);
184                 serialised = 1;
185                 break;
186         }
187
188         CDEBUG(D_IOCTL, "cmd = %x, obd = %p\n", cmd, obd);
189         if (obd_ioctl_getdata(&buf, &len, (void *)arg)) {
190                 CERROR("OBD ioctl: data error\n");
191                 GOTO(out, err = -EINVAL);
192         }
193         data = (struct obd_ioctl_data *)buf;
194
195         switch (cmd) {
196         case OBD_IOC_PROCESS_CFG: {
197                 char *buf;
198                 struct lustre_cfg *lcfg;
199
200                 /* FIXME hack to liblustre dump, remove when switch
201                    to zeroconf */
202 #ifndef __KERNEL__
203                 data->ioc_pbuf1 = data->ioc_inlbuf1;
204                 data->ioc_plen1 = data->ioc_inllen1;
205 #endif
206                 if (!data->ioc_plen1 || !data->ioc_pbuf1) {
207                         CERROR("No config buffer passed!\n");
208                         GOTO(out, err = -EINVAL);
209                 }
210                 err = lustre_cfg_getdata(&buf, data->ioc_plen1,
211                                          data->ioc_pbuf1, 0);
212                 if (err)
213                         GOTO(out, err);
214                 lcfg = (struct lustre_cfg* ) buf;
215
216                 err = class_process_config(lcfg);
217                 lustre_cfg_freedata(buf, data->ioc_plen1);
218                 GOTO(out, err);
219         }
220
221         case OBD_IOC_LIST: {
222                 int i;
223                 char *buf2 = data->ioc_bulk;
224                 int remains = data->ioc_inllen1;
225
226                 if (!data->ioc_inlbuf1) {
227                         CERROR("No buffer passed!\n");
228                         GOTO(out, err = -EINVAL);
229                 }
230
231
232                 for (i = 0 ; i < MAX_OBD_DEVICES ; i++) {
233                         int l;
234                         char *status;
235                         struct obd_device *obd = &obd_dev[i];
236
237                         if (!obd->obd_type)
238                                 continue;
239                         if (obd->obd_stopping)
240                                 status = "ST";
241                         else if (obd->obd_set_up)
242                                 status = "UP";
243                         else if (obd->obd_attached)
244                                 status = "AT";
245                         else
246                                 status = "-";
247                         l = snprintf(buf2, remains, "%2d %s %s %s %s %d\n",
248                                      i, status, obd->obd_type->typ_name,
249                                      obd->obd_name, obd->obd_uuid.uuid,
250                                      obd->obd_type->typ_refcnt);
251                         buf2 +=l;
252                         remains -=l;
253                         if (remains <= 0) {
254                                 CERROR("not enough space for device listing\n");
255                                 break;
256                         }
257                 }
258
259                 err = copy_to_user((void *)arg, data, len);
260                 if (err)
261                         err = -EFAULT;
262                 GOTO(out, err);
263         }
264
265         case OBD_GET_VERSION:
266                 if (!data->ioc_inlbuf1) {
267                         CERROR("No buffer passed in ioctl\n");
268                         GOTO(out, err = -EINVAL);
269                 }
270
271                 if (strlen(BUILD_VERSION) + 1 > data->ioc_inllen1) {
272                         CERROR("ioctl buffer too small to hold version\n");
273                         GOTO(out, err = -EINVAL);
274                 }
275
276                 memcpy(data->ioc_bulk, BUILD_VERSION,
277                        strlen(BUILD_VERSION) + 1);
278
279                 err = copy_to_user((void *)arg, data, len);
280                 if (err)
281                         err = -EFAULT;
282                 GOTO(out, err);
283
284         case OBD_IOC_NAME2DEV: {
285                 /* Resolve a device name.  This does not change the
286                  * currently selected device.
287                  */
288                 int dev;
289
290                 dev = class_resolve_dev_name(data->ioc_inllen1,
291                                              data->ioc_inlbuf1);
292                 data->ioc_dev = dev;
293                 if (dev < 0)
294                         GOTO(out, err = -EINVAL);
295
296                 err = copy_to_user((void *)arg, data, sizeof(*data));
297                 if (err)
298                         err = -EFAULT;
299                 GOTO(out, err);
300         }
301
302         case OBD_IOC_UUID2DEV: {
303                 /* Resolve a device uuid.  This does not change the
304                  * currently selected device.
305                  */
306                 int dev;
307                 struct obd_uuid uuid;
308
309                 if (!data->ioc_inllen1 || !data->ioc_inlbuf1) {
310                         CERROR("No UUID passed!\n");
311                         GOTO(out, err = -EINVAL);
312                 }
313                 if (data->ioc_inlbuf1[data->ioc_inllen1 - 1] != 0) {
314                         CERROR("UUID not NUL terminated!\n");
315                         GOTO(out, err = -EINVAL);
316                 }
317
318                 CDEBUG(D_IOCTL, "device name %s\n", data->ioc_inlbuf1);
319                 obd_str2uuid(&uuid, data->ioc_inlbuf1);
320                 dev = class_uuid2dev(&uuid);
321                 data->ioc_dev = dev;
322                 if (dev == -1) {
323                         CDEBUG(D_IOCTL, "No device for UUID %s!\n",
324                                data->ioc_inlbuf1);
325                         GOTO(out, err = -EINVAL);
326                 }
327
328                 CDEBUG(D_IOCTL, "device name %s, dev %d\n", data->ioc_inlbuf1,
329                        dev);
330                 err = copy_to_user((void *)arg, data, sizeof(*data));
331                 if (err)
332                         err = -EFAULT;
333                 GOTO(out, err);
334         }
335
336
337         case OBD_IOC_CLOSE_UUID: {
338                 struct lustre_peer peer;
339                 CDEBUG(D_IOCTL, "closing all connections to uuid %s\n",
340                        data->ioc_inlbuf1);
341                 lustre_uuid_to_peer(data->ioc_inlbuf1, &peer);
342                 GOTO(out, err = 0);
343         }
344
345         }
346
347         if (data->ioc_dev >= MAX_OBD_DEVICES) {
348                 CERROR("OBD ioctl: No device\n");
349                 GOTO(out, err = -EINVAL);
350         } 
351         obd = &obd_dev[data->ioc_dev];
352         if (!(obd && obd->obd_set_up) || obd->obd_stopping) {
353                 CERROR("OBD ioctl: device not setup %d \n", data->ioc_dev);
354                 GOTO(out, err = -EINVAL);
355         }
356
357         switch(cmd) {
358         case OBD_IOC_NO_TRANSNO: {
359                 if (!obd->obd_attached) {
360                         CERROR("Device %d not attached\n", obd->obd_minor);
361                         GOTO(out, err = -ENODEV);
362                 }
363                 CDEBUG(D_IOCTL,
364                        "disabling committed-transno notifications on %d\n",
365                        obd->obd_minor);
366                 obd->obd_no_transno = 1;
367                 GOTO(out, err = 0);
368         }
369
370         default: {
371                 err = obd_iocontrol(cmd, obd->obd_self_export, len, data, NULL);
372                 if (err)
373                         GOTO(out, err);
374
375                 err = copy_to_user((void *)arg, data, len);
376                 if (err)
377                         err = -EFAULT;
378                 GOTO(out, err);
379         }
380         }
381
382  out:
383         if (buf)
384                 obd_ioctl_freedata(buf, len);
385         if (serialised)
386                 up(&obd_conf_sem);
387         RETURN(err);
388 } /* class_handle_ioctl */
389
390
391
392 #define OBD_MINOR 241
393 #ifdef __KERNEL__
394 /* to control /dev/obd */
395 static int obd_class_ioctl(struct inode *inode, struct file *filp,
396                            unsigned int cmd, unsigned long arg)
397 {
398         return class_handle_ioctl(cmd, arg);
399 }
400
401 /* declare character device */
402 static struct file_operations obd_psdev_fops = {
403         ioctl:   obd_class_ioctl,       /* ioctl */
404         open:    obd_class_open,        /* open */
405         release: obd_class_release,     /* release */
406 };
407
408 /* modules setup */
409 static struct miscdevice obd_psdev = {
410         OBD_MINOR,
411         "obd_psdev",
412         &obd_psdev_fops
413 };
414 #else
415 void *obd_psdev = NULL;
416 #endif
417
418 EXPORT_SYMBOL(obd_dev);
419 EXPORT_SYMBOL(obdo_cachep);
420 EXPORT_SYMBOL(obd_memory);
421 EXPORT_SYMBOL(obd_memmax);
422 EXPORT_SYMBOL(obd_fail_loc);
423 EXPORT_SYMBOL(obd_timeout);
424 EXPORT_SYMBOL(obd_lustre_upcall);
425 EXPORT_SYMBOL(obd_sync_filter);
426 EXPORT_SYMBOL(ptlrpc_put_connection_superhack);
427 EXPORT_SYMBOL(ptlrpc_abort_inflight_superhack);
428 EXPORT_SYMBOL(proc_lustre_root);
429
430 EXPORT_SYMBOL(class_register_type);
431 EXPORT_SYMBOL(class_unregister_type);
432 EXPORT_SYMBOL(class_get_type);
433 EXPORT_SYMBOL(class_put_type);
434 EXPORT_SYMBOL(class_name2dev);
435 EXPORT_SYMBOL(class_name2obd);
436 EXPORT_SYMBOL(class_uuid2dev);
437 EXPORT_SYMBOL(class_uuid2obd);
438 EXPORT_SYMBOL(class_find_client_obd);
439 EXPORT_SYMBOL(__class_export_put);
440 EXPORT_SYMBOL(class_new_export);
441 EXPORT_SYMBOL(class_unlink_export);
442 EXPORT_SYMBOL(class_import_get);
443 EXPORT_SYMBOL(class_import_put);
444 EXPORT_SYMBOL(class_new_import);
445 EXPORT_SYMBOL(class_destroy_import);
446 EXPORT_SYMBOL(class_connect);
447 EXPORT_SYMBOL(class_conn2export);
448 EXPORT_SYMBOL(class_exp2obd);
449 EXPORT_SYMBOL(class_conn2obd);
450 EXPORT_SYMBOL(class_exp2cliimp);
451 EXPORT_SYMBOL(class_conn2cliimp);
452 EXPORT_SYMBOL(class_disconnect);
453 EXPORT_SYMBOL(class_disconnect_exports);
454
455 EXPORT_SYMBOL(osic_init);
456 EXPORT_SYMBOL(osic_release);
457 EXPORT_SYMBOL(osic_add_one);
458 EXPORT_SYMBOL(osic_wait);
459 EXPORT_SYMBOL(osic_complete_one);
460
461 /* uuid.c */
462 EXPORT_SYMBOL(class_uuid_unparse);
463 EXPORT_SYMBOL(lustre_uuid_to_peer);
464
465 EXPORT_SYMBOL(class_handle_hash);
466 EXPORT_SYMBOL(class_handle_unhash);
467 EXPORT_SYMBOL(class_handle2object);
468
469 /* config.c */
470 EXPORT_SYMBOL(class_get_profile);
471 EXPORT_SYMBOL(class_process_config);
472 EXPORT_SYMBOL(class_config_parse_llog);
473 EXPORT_SYMBOL(class_config_dump_llog);
474 EXPORT_SYMBOL(class_attach);
475 EXPORT_SYMBOL(class_setup);
476 EXPORT_SYMBOL(class_cleanup);
477 EXPORT_SYMBOL(class_detach);
478
479 #ifdef LPROCFS
480 int obd_proc_read_version(char *page, char **start, off_t off, int count,
481                           int *eof, void *data)
482 {
483         *eof = 1;
484         return snprintf(page, count, "%s\n", BUILD_VERSION);
485 }
486
487 int obd_proc_read_pinger(char *page, char **start, off_t off, int count,
488                          int *eof, void *data)
489 {
490         *eof = 1;
491         return snprintf(page, count, "%s\n",
492 #ifdef ENABLE_PINGER
493                         "on"
494 #else
495                         "off"
496 #endif
497                        );
498 }
499
500 /* Root for /proc/fs/lustre */
501 struct proc_dir_entry *proc_lustre_root = NULL;
502 struct lprocfs_vars lprocfs_base[] = {
503         { "version", obd_proc_read_version, NULL, NULL },
504         { "pinger", obd_proc_read_pinger, NULL, NULL },
505         { 0 }
506 };
507
508 static void *obd_device_list_seq_start(struct seq_file *p, loff_t*pos)
509 {
510         if (*pos >= MAX_OBD_DEVICES)
511                 return NULL;
512         return &obd_dev[*pos];
513 }
514
515 static void obd_device_list_seq_stop(struct seq_file *p, void *v)
516 {
517 }
518
519 static void *obd_device_list_seq_next(struct seq_file *p, void *v, loff_t *pos)
520 {
521         ++*pos;
522         if (*pos >= MAX_OBD_DEVICES)
523                 return NULL;
524         return &obd_dev[*pos];
525 }
526
527 static int obd_device_list_seq_show(struct seq_file *p, void *v)
528 {
529         struct obd_device *obd = (struct obd_device *)v;
530         int index = obd - &obd_dev[0];
531         char *status;
532
533         if (!obd->obd_type)
534                 return 0;
535         if (obd->obd_stopping)
536                 status = "ST";
537         else if (obd->obd_set_up)
538                 status = "UP";
539         else if (obd->obd_attached)
540                 status = "AT";
541         else
542                 status = "--";
543
544         return seq_printf(p, "%3d %s %s %s %s %d\n",
545                           (int)index, status, obd->obd_type->typ_name,
546                           obd->obd_name, obd->obd_uuid.uuid,
547                           atomic_read(&obd->obd_refcount));
548 }
549
550 struct seq_operations obd_device_list_sops = {
551         .start = obd_device_list_seq_start,
552         .stop = obd_device_list_seq_stop,
553         .next = obd_device_list_seq_next,
554         .show = obd_device_list_seq_show,
555 };
556
557 static int obd_device_list_open(struct inode *inode, struct file *file)
558 {
559         struct proc_dir_entry *dp = inode->u.generic_ip;
560         struct seq_file *seq;
561         int rc = seq_open(file, &obd_device_list_sops);
562
563         if (rc)
564                 return rc;
565
566         seq = file->private_data;
567         seq->private = dp->data;
568
569         return 0;
570 }
571
572 struct file_operations obd_device_list_fops = {
573         .open = obd_device_list_open,
574         .read = seq_read,
575         .llseek = seq_lseek,
576         .release = seq_release,
577 };
578 #endif
579
580 #ifdef __KERNEL__
581 static int __init init_obdclass(void)
582 #else
583 int init_obdclass(void)
584 #endif
585 {
586         struct obd_device *obd;
587 #ifdef LPROCFS
588         struct proc_dir_entry *entry;
589 #endif
590         int err;
591         int i;
592
593         printk(KERN_INFO "Lustre: OBD class driver Build Version: "
594                BUILD_VERSION", info@clusterfs.com\n");
595
596         class_init_uuidlist();
597         err = class_handle_init();
598         if (err)
599                 return err;
600
601         sema_init(&obd_conf_sem, 1);
602         INIT_LIST_HEAD(&obd_types);
603
604         err = misc_register(&obd_psdev);
605         if (err) {
606                 CERROR("cannot register %d err %d\n", OBD_MINOR, err);
607                 return err;
608         }
609
610         /* This struct is already zerod for us (static global) */
611         for (i = 0, obd = obd_dev; i < MAX_OBD_DEVICES; i++, obd++)
612                 obd->obd_minor = i;
613
614         err = obd_init_caches();
615         if (err)
616                 return err;
617
618 #ifdef __KERNEL__
619         obd_sysctl_init();
620 #endif
621
622 #ifdef LPROCFS
623         proc_lustre_root = proc_mkdir("lustre", proc_root_fs);
624         if (!proc_lustre_root) {
625                 printk(KERN_ERR
626                        "LustreError: error registering /proc/fs/lustre\n");
627                 RETURN(-ENOMEM);
628         }
629         proc_version = lprocfs_add_vars(proc_lustre_root, lprocfs_base, NULL);
630         entry = create_proc_entry("devices", 0444, proc_lustre_root);
631         if (entry == NULL) {
632                 printk(KERN_ERR "LustreError: error registering "
633                        "/proc/fs/lustre/devices\n");
634                 lprocfs_remove(proc_lustre_root);
635                 RETURN(-ENOMEM);
636         }
637         entry->proc_fops = &obd_device_list_fops;
638 #endif
639         return 0;
640 }
641
642 #ifdef __KERNEL__
643 static void /*__exit*/ cleanup_obdclass(void)
644 #else
645 static void cleanup_obdclass(void)
646 #endif
647 {
648         int i, leaked;
649         ENTRY;
650
651         misc_deregister(&obd_psdev);
652         for (i = 0; i < MAX_OBD_DEVICES; i++) {
653                 struct obd_device *obd = &obd_dev[i];
654                 if (obd->obd_type && obd->obd_set_up &&
655                     OBT(obd) && OBP(obd, detach)) {
656                         /* XXX should this call generic detach otherwise? */
657                         OBP(obd, detach)(obd);
658                 }
659         }
660
661         obd_cleanup_caches();
662 #ifdef __KERNEL__
663         obd_sysctl_clean();
664 #endif
665 #ifdef LPROCFS
666         if (proc_lustre_root) {
667                 lprocfs_remove(proc_lustre_root);
668                 proc_lustre_root = NULL;
669         }
670 #endif
671
672         class_handle_cleanup();
673         class_exit_uuidlist();
674
675         leaked = atomic_read(&obd_memory);
676         CDEBUG(leaked ? D_ERROR : D_INFO,
677                "obd mem max: %d leaked: %d\n", obd_memmax, leaked);
678
679         EXIT;
680 }
681
682 /* Check that we're building against the appropriate version of the Lustre
683  * kernel patch */
684 #ifdef __KERNEL__
685 #include <linux/lustre_version.h>
686 #define LUSTRE_MIN_VERSION 28
687 #define LUSTRE_MAX_VERSION 32
688 #if (LUSTRE_KERNEL_VERSION < LUSTRE_MIN_VERSION)
689 # error Cannot continue: Your Lustre kernel patch is older than the sources
690 #elif (LUSTRE_KERNEL_VERSION > LUSTRE_MAX_VERSION)
691 # error Cannot continue: Your Lustre sources are older than the kernel patch
692 #endif
693  #else
694 # warning "Lib Lustre - no versioning information"
695 #endif
696
697 #ifdef __KERNEL__
698 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
699 MODULE_DESCRIPTION("Lustre Class Driver Build Version: " BUILD_VERSION);
700 MODULE_LICENSE("GPL");
701
702 module_init(init_obdclass);
703 module_exit(cleanup_obdclass);
704 #endif