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