Whamcloud - gitweb
94f9fd957c9a8d127ac48bb2b57014869c16f3a6
[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  * GPL HEADER START
5  *
6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 only,
10  * as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License version 2 for more details (a copy is included
16  * in the LICENSE file that accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License
19  * version 2 along with this program; If not, see
20  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
21  *
22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23  * CA 95054 USA or visit www.sun.com if you need additional information or
24  * have any questions.
25  *
26  * GPL HEADER END
27  */
28 /*
29  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
30  * Use is subject to license terms.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  */
36
37 #define DEBUG_SUBSYSTEM S_CLASS
38 #ifndef EXPORT_SYMTAB
39 # define EXPORT_SYMTAB
40 #endif
41 #ifndef __KERNEL__
42 # include <liblustre.h>
43 #else
44 # include <asm/atomic.h>
45 #endif
46
47 #include <obd_support.h>
48 #include <obd_class.h>
49 #include <lnet/lnetctl.h>
50 #include <lustre_debug.h>
51 #include <lprocfs_status.h>
52 #include <lustre/lustre_build_version.h>
53 #include <libcfs/list.h>
54 #include "llog_internal.h"
55
56 #ifndef __KERNEL__
57 /* liblustre workaround */
58 cfs_atomic_t libcfs_kmemory = {0};
59 #endif
60
61 struct obd_device *obd_devs[MAX_OBD_DEVICES];
62 cfs_list_t obd_types;
63 cfs_spinlock_t obd_dev_lock = CFS_SPIN_LOCK_UNLOCKED;
64
65 #ifndef __KERNEL__
66 __u64 obd_max_pages = 0;
67 __u64 obd_max_alloc = 0;
68 __u64 obd_alloc;
69 __u64 obd_pages;
70 #endif
71
72 /* The following are visible and mutable through /proc/sys/lustre/. */
73 unsigned int obd_debug_peer_on_timeout;
74 unsigned int obd_dump_on_timeout;
75 unsigned int obd_dump_on_eviction;
76 unsigned int obd_max_dirty_pages = 256;
77 unsigned int obd_timeout = OBD_TIMEOUT_DEFAULT;   /* seconds */
78 unsigned int ldlm_timeout = LDLM_TIMEOUT_DEFAULT; /* seconds */
79 /* Adaptive timeout defs here instead of ptlrpc module for /proc/sys/ access */
80 unsigned int at_min = 0;
81 unsigned int at_max = 600;
82 unsigned int at_history = 600;
83 int at_early_margin = 5;
84 int at_extra = 30;
85
86 cfs_atomic_t obd_dirty_pages;
87 cfs_atomic_t obd_dirty_transit_pages;
88
89 static inline void obd_data2conn(struct lustre_handle *conn,
90                                  struct obd_ioctl_data *data)
91 {
92         memset(conn, 0, sizeof *conn);
93         conn->cookie = data->ioc_cookie;
94 }
95
96 static inline void obd_conn2data(struct obd_ioctl_data *data,
97                                  struct lustre_handle *conn)
98 {
99         data->ioc_cookie = conn->cookie;
100 }
101
102 int class_resolve_dev_name(__u32 len, const char *name)
103 {
104         int rc;
105         int dev;
106
107         ENTRY;
108         if (!len || !name) {
109                 CERROR("No name passed,!\n");
110                 GOTO(out, rc = -EINVAL);
111         }
112         if (name[len - 1] != 0) {
113                 CERROR("Name not nul terminated!\n");
114                 GOTO(out, rc = -EINVAL);
115         }
116
117         CDEBUG(D_IOCTL, "device name %s\n", name);
118         dev = class_name2dev(name);
119         if (dev == -1) {
120                 CDEBUG(D_IOCTL, "No device for name %s!\n", name);
121                 GOTO(out, rc = -EINVAL);
122         }
123
124         CDEBUG(D_IOCTL, "device name %s, dev %d\n", name, dev);
125         rc = dev;
126
127 out:
128         RETURN(rc);
129 }
130
131 int class_handle_ioctl(unsigned int cmd, unsigned long arg)
132 {
133         char *buf = NULL;
134         struct obd_ioctl_data *data;
135         struct libcfs_debug_ioctl_data *debug_data;
136         struct obd_device *obd = NULL;
137         int err = 0, len = 0;
138         ENTRY;
139
140         /* only for debugging */
141         if (cmd == LIBCFS_IOC_DEBUG_MASK) {
142                 debug_data = (struct libcfs_debug_ioctl_data*)arg;
143                 libcfs_subsystem_debug = debug_data->subs;
144                 libcfs_debug = debug_data->debug;
145                 return 0;
146         }
147
148         CDEBUG(D_IOCTL, "cmd = %x\n", cmd);
149         if (obd_ioctl_getdata(&buf, &len, (void *)arg)) {
150                 CERROR("OBD ioctl: data error\n");
151                 RETURN(-EINVAL);
152         }
153         data = (struct obd_ioctl_data *)buf;
154
155         switch (cmd) {
156         case OBD_IOC_PROCESS_CFG: {
157                 struct lustre_cfg *lcfg;
158
159                 if (!data->ioc_plen1 || !data->ioc_pbuf1) {
160                         CERROR("No config buffer passed!\n");
161                         GOTO(out, err = -EINVAL);
162                 }
163                 OBD_ALLOC(lcfg, data->ioc_plen1);
164                 if (lcfg == NULL)
165                         GOTO(out, err = -ENOMEM);
166                 err = cfs_copy_from_user(lcfg, data->ioc_pbuf1,
167                                          data->ioc_plen1);
168                 if (!err)
169                         err = lustre_cfg_sanity_check(lcfg, data->ioc_plen1);
170                 if (!err)
171                         err = class_process_config(lcfg);
172
173                 OBD_FREE(lcfg, data->ioc_plen1);
174                 GOTO(out, err);
175         }
176
177         case OBD_GET_VERSION:
178                 if (!data->ioc_inlbuf1) {
179                         CERROR("No buffer passed in ioctl\n");
180                         GOTO(out, err = -EINVAL);
181                 }
182
183                 if (strlen(BUILD_VERSION) + 1 > data->ioc_inllen1) {
184                         CERROR("ioctl buffer too small to hold version\n");
185                         GOTO(out, err = -EINVAL);
186                 }
187
188                 memcpy(data->ioc_bulk, BUILD_VERSION,
189                        strlen(BUILD_VERSION) + 1);
190
191                 err = obd_ioctl_popdata((void *)arg, data, len);
192                 if (err)
193                         err = -EFAULT;
194                 GOTO(out, err);
195
196         case OBD_IOC_NAME2DEV: {
197                 /* Resolve a device name.  This does not change the
198                  * currently selected device.
199                  */
200                 int dev;
201
202                 dev = class_resolve_dev_name(data->ioc_inllen1,
203                                              data->ioc_inlbuf1);
204                 data->ioc_dev = dev;
205                 if (dev < 0)
206                         GOTO(out, err = -EINVAL);
207
208                 err = obd_ioctl_popdata((void *)arg, data, sizeof(*data));
209                 if (err)
210                         err = -EFAULT;
211                 GOTO(out, err);
212         }
213
214         case OBD_IOC_UUID2DEV: {
215                 /* Resolve a device uuid.  This does not change the
216                  * currently selected device.
217                  */
218                 int dev;
219                 struct obd_uuid uuid;
220
221                 if (!data->ioc_inllen1 || !data->ioc_inlbuf1) {
222                         CERROR("No UUID passed!\n");
223                         GOTO(out, err = -EINVAL);
224                 }
225                 if (data->ioc_inlbuf1[data->ioc_inllen1 - 1] != 0) {
226                         CERROR("UUID not NUL terminated!\n");
227                         GOTO(out, err = -EINVAL);
228                 }
229
230                 CDEBUG(D_IOCTL, "device name %s\n", data->ioc_inlbuf1);
231                 obd_str2uuid(&uuid, data->ioc_inlbuf1);
232                 dev = class_uuid2dev(&uuid);
233                 data->ioc_dev = dev;
234                 if (dev == -1) {
235                         CDEBUG(D_IOCTL, "No device for UUID %s!\n",
236                                data->ioc_inlbuf1);
237                         GOTO(out, err = -EINVAL);
238                 }
239
240                 CDEBUG(D_IOCTL, "device name %s, dev %d\n", data->ioc_inlbuf1,
241                        dev);
242                 err = obd_ioctl_popdata((void *)arg, data, sizeof(*data));
243                 if (err)
244                         err = -EFAULT;
245                 GOTO(out, err);
246         }
247
248         case OBD_IOC_CLOSE_UUID: {
249                 CDEBUG(D_IOCTL, "closing all connections to uuid %s (NOOP)\n",
250                        data->ioc_inlbuf1);
251                 GOTO(out, err = 0);
252         }
253
254         case OBD_IOC_GETDEVICE: {
255                 int     index = data->ioc_count;
256                 char    *status, *str;
257
258                 if (!data->ioc_inlbuf1) {
259                         CERROR("No buffer passed in ioctl\n");
260                         GOTO(out, err = -EINVAL);
261                 }
262                 if (data->ioc_inllen1 < 128) {
263                         CERROR("ioctl buffer too small to hold version\n");
264                         GOTO(out, err = -EINVAL);
265                 }
266
267                 obd = class_num2obd(index);
268                 if (!obd)
269                         GOTO(out, err = -ENOENT);
270
271                 if (obd->obd_stopping)
272                         status = "ST";
273                 else if (obd->obd_set_up)
274                         status = "UP";
275                 else if (obd->obd_attached)
276                         status = "AT";
277                 else
278                         status = "--";
279                 str = (char *)data->ioc_bulk;
280                 snprintf(str, len - sizeof(*data), "%3d %s %s %s %s %d",
281                          (int)index, status, obd->obd_type->typ_name,
282                          obd->obd_name, obd->obd_uuid.uuid,
283                          cfs_atomic_read(&obd->obd_refcount));
284                 err = obd_ioctl_popdata((void *)arg, data, len);
285
286                 GOTO(out, err = 0);
287         }
288
289         }
290
291         if (data->ioc_dev == OBD_DEV_BY_DEVNAME) {
292                 if (data->ioc_inllen4 <= 0 || data->ioc_inlbuf4 == NULL)
293                         GOTO(out, err = -EINVAL);
294                 if (strnlen(data->ioc_inlbuf4, MAX_OBD_NAME) >= MAX_OBD_NAME)
295                         GOTO(out, err = -EINVAL);
296                 obd = class_name2obd(data->ioc_inlbuf4);
297         } else if (data->ioc_dev < class_devno_max()) {
298                 obd = class_num2obd(data->ioc_dev);
299         } else {
300                 CERROR("OBD ioctl: No device\n");
301                 GOTO(out, err = -EINVAL);
302         }
303
304         if (obd == NULL) {
305                 CERROR("OBD ioctl : No Device %d\n", data->ioc_dev);
306                 GOTO(out, err = -EINVAL);
307         }
308         LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
309
310         if (!obd->obd_set_up || obd->obd_stopping) {
311                 CERROR("OBD ioctl: device not setup %d \n", data->ioc_dev);
312                 GOTO(out, err = -EINVAL);
313         }
314
315         switch(cmd) {
316         case OBD_IOC_NO_TRANSNO: {
317                 if (!obd->obd_attached) {
318                         CERROR("Device %d not attached\n", obd->obd_minor);
319                         GOTO(out, err = -ENODEV);
320                 }
321                 CDEBUG(D_HA, "%s: disabling committed-transno notification\n",
322                        obd->obd_name);
323                 obd->obd_no_transno = 1;
324                 GOTO(out, err = 0);
325         }
326
327         default: {
328                 err = obd_iocontrol(cmd, obd->obd_self_export, len, data, NULL);
329                 if (err)
330                         GOTO(out, err);
331
332                 err = obd_ioctl_popdata((void *)arg, data, len);
333                 if (err)
334                         err = -EFAULT;
335                 GOTO(out, err);
336         }
337         }
338
339  out:
340         if (buf)
341                 obd_ioctl_freedata(buf, len);
342         RETURN(err);
343 } /* class_handle_ioctl */
344
345
346
347 #ifdef __KERNEL__
348 extern cfs_psdev_t obd_psdev;
349 #else
350 void *obd_psdev = NULL;
351 #endif
352
353 EXPORT_SYMBOL(obd_devs);
354 EXPORT_SYMBOL(obd_debug_peer_on_timeout);
355 EXPORT_SYMBOL(obd_dump_on_timeout);
356 EXPORT_SYMBOL(obd_dump_on_eviction);
357 EXPORT_SYMBOL(obd_timeout);
358 EXPORT_SYMBOL(ldlm_timeout);
359 EXPORT_SYMBOL(obd_max_dirty_pages);
360 EXPORT_SYMBOL(obd_dirty_pages);
361 EXPORT_SYMBOL(obd_dirty_transit_pages);
362 EXPORT_SYMBOL(at_min);
363 EXPORT_SYMBOL(at_max);
364 EXPORT_SYMBOL(at_extra);
365 EXPORT_SYMBOL(at_early_margin);
366 EXPORT_SYMBOL(at_history);
367 EXPORT_SYMBOL(ptlrpc_put_connection_superhack);
368
369 EXPORT_SYMBOL(proc_lustre_root);
370
371 EXPORT_SYMBOL(class_register_type);
372 EXPORT_SYMBOL(class_unregister_type);
373 EXPORT_SYMBOL(class_get_type);
374 EXPORT_SYMBOL(class_put_type);
375 EXPORT_SYMBOL(class_name2dev);
376 EXPORT_SYMBOL(class_name2obd);
377 EXPORT_SYMBOL(class_uuid2dev);
378 EXPORT_SYMBOL(class_uuid2obd);
379 EXPORT_SYMBOL(class_find_client_obd);
380 EXPORT_SYMBOL(class_devices_in_group);
381 EXPORT_SYMBOL(class_conn2export);
382 EXPORT_SYMBOL(class_exp2obd);
383 EXPORT_SYMBOL(class_conn2obd);
384 EXPORT_SYMBOL(class_exp2cliimp);
385 EXPORT_SYMBOL(class_conn2cliimp);
386 EXPORT_SYMBOL(class_disconnect);
387 EXPORT_SYMBOL(class_num2obd);
388
389 /* uuid.c */
390 EXPORT_SYMBOL(class_uuid_unparse);
391 EXPORT_SYMBOL(lustre_uuid_to_peer);
392
393 EXPORT_SYMBOL(class_handle_hash);
394 EXPORT_SYMBOL(class_handle_unhash);
395 EXPORT_SYMBOL(class_handle_hash_back);
396 EXPORT_SYMBOL(class_handle2object);
397 EXPORT_SYMBOL(class_handle_free_cb);
398
399 /* obd_config.c */
400 EXPORT_SYMBOL(class_incref);
401 EXPORT_SYMBOL(class_decref);
402 EXPORT_SYMBOL(class_get_profile);
403 EXPORT_SYMBOL(class_del_profile);
404 EXPORT_SYMBOL(class_del_profiles);
405 EXPORT_SYMBOL(class_process_config);
406 EXPORT_SYMBOL(class_process_proc_param);
407 EXPORT_SYMBOL(class_config_parse_llog);
408 EXPORT_SYMBOL(class_config_dump_llog);
409 EXPORT_SYMBOL(class_attach);
410 EXPORT_SYMBOL(class_setup);
411 EXPORT_SYMBOL(class_cleanup);
412 EXPORT_SYMBOL(class_detach);
413 EXPORT_SYMBOL(class_manual_cleanup);
414
415 /* mea.c */
416 EXPORT_SYMBOL(mea_name2idx);
417 EXPORT_SYMBOL(raw_name2idx);
418
419 #define OBD_INIT_CHECK
420 #ifdef OBD_INIT_CHECK
421 int obd_init_checks(void)
422 {
423         __u64 u64val, div64val;
424         char buf[64];
425         int len, ret = 0;
426
427         CDEBUG(D_INFO, "LPU64=%s, LPD64=%s, LPX64=%s\n", LPU64, LPD64, LPX64);
428
429         CDEBUG(D_INFO, "OBD_OBJECT_EOF = "LPX64"\n", (__u64)OBD_OBJECT_EOF);
430
431         u64val = OBD_OBJECT_EOF;
432         CDEBUG(D_INFO, "u64val OBD_OBJECT_EOF = "LPX64"\n", u64val);
433         if (u64val != OBD_OBJECT_EOF) {
434                 CERROR("__u64 "LPX64"(%d) != 0xffffffffffffffff\n",
435                        u64val, (int)sizeof(u64val));
436                 ret = -EINVAL;
437         }
438         len = snprintf(buf, sizeof(buf), LPX64, u64val);
439         if (len != 18) {
440                 CWARN("LPX64 wrong length! strlen(%s)=%d != 18\n", buf, len);
441                 ret = -EINVAL;
442         }
443
444         div64val = OBD_OBJECT_EOF;
445         CDEBUG(D_INFO, "u64val OBD_OBJECT_EOF = "LPX64"\n", u64val);
446         if (u64val != OBD_OBJECT_EOF) {
447                 CERROR("__u64 "LPX64"(%d) != 0xffffffffffffffff\n",
448                        u64val, (int)sizeof(u64val));
449                 ret = -EOVERFLOW;
450         }
451         if (u64val >> 8 != OBD_OBJECT_EOF >> 8) {
452                 CERROR("__u64 "LPX64"(%d) != 0xffffffffffffffff\n",
453                        u64val, (int)sizeof(u64val));
454                 return -EOVERFLOW;
455         }
456         if (do_div(div64val, 256) != (u64val & 255)) {
457                 CERROR("do_div("LPX64",256) != "LPU64"\n", u64val, u64val &255);
458                 return -EOVERFLOW;
459         }
460         if (u64val >> 8 != div64val) {
461                 CERROR("do_div("LPX64",256) "LPU64" != "LPU64"\n",
462                        u64val, div64val, u64val >> 8);
463                 return -EOVERFLOW;
464         }
465         len = snprintf(buf, sizeof(buf), LPX64, u64val);
466         if (len != 18) {
467                 CWARN("LPX64 wrong length! strlen(%s)=%d != 18\n", buf, len);
468                 ret = -EINVAL;
469         }
470         len = snprintf(buf, sizeof(buf), LPU64, u64val);
471         if (len != 20) {
472                 CWARN("LPU64 wrong length! strlen(%s)=%d != 20\n", buf, len);
473                 ret = -EINVAL;
474         }
475         len = snprintf(buf, sizeof(buf), LPD64, u64val);
476         if (len != 2) {
477                 CWARN("LPD64 wrong length! strlen(%s)=%d != 2\n", buf, len);
478                 ret = -EINVAL;
479         }
480         if ((u64val & ~CFS_PAGE_MASK) >= CFS_PAGE_SIZE) {
481                 CWARN("mask failed: u64val "LPU64" >= "LPU64"\n", u64val,
482                       (__u64)CFS_PAGE_SIZE);
483                 ret = -EINVAL;
484         }
485
486         return ret;
487 }
488 #else
489 #define obd_init_checks() do {} while(0)
490 #endif
491
492 extern cfs_spinlock_t obd_types_lock;
493 extern int class_procfs_init(void);
494 extern int class_procfs_clean(void);
495
496 #ifdef __KERNEL__
497 static int __init init_obdclass(void)
498 #else
499 int init_obdclass(void)
500 #endif
501 {
502         int i, err;
503 #ifdef __KERNEL__
504         int lustre_register_fs(void);
505
506         for (i = CAPA_SITE_CLIENT; i < CAPA_SITE_MAX; i++)
507                 CFS_INIT_LIST_HEAD(&capa_list[i]);
508 #endif
509
510 #ifdef CRAY_XT3
511         LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n");
512 #else
513         LCONSOLE_INFO("OBD class driver, http://www.lustre.org/\n");
514         LCONSOLE_INFO("        Lustre Version: "LUSTRE_VERSION_STRING"\n");
515         LCONSOLE_INFO("        Build Version: "BUILD_VERSION"\n");
516 #endif
517
518         cfs_spin_lock_init(&obd_types_lock);
519         obd_zombie_impexp_init();
520 #ifdef LPROCFS
521         obd_memory = lprocfs_alloc_stats(OBD_STATS_NUM,
522                                          LPROCFS_STATS_FLAG_NONE);
523         if (obd_memory == NULL) {
524                 CERROR("kmalloc of 'obd_memory' failed\n");
525                 RETURN(-ENOMEM);
526         }
527
528         lprocfs_counter_init(obd_memory, OBD_MEMORY_STAT,
529                              LPROCFS_CNTR_AVGMINMAX,
530                              "memused", "bytes");
531         lprocfs_counter_init(obd_memory, OBD_MEMORY_PAGES_STAT,
532                              LPROCFS_CNTR_AVGMINMAX,
533                              "pagesused", "pages");
534 #endif
535         err = obd_init_checks();
536         if (err == -EOVERFLOW)
537                 return err;
538
539         class_init_uuidlist();
540         err = class_handle_init();
541         if (err)
542                 return err;
543
544         cfs_spin_lock_init(&obd_dev_lock);
545         CFS_INIT_LIST_HEAD(&obd_types);
546
547         err = cfs_psdev_register(&obd_psdev);
548         if (err) {
549                 CERROR("cannot register %d err %d\n", OBD_DEV_MINOR, err);
550                 return err;
551         }
552
553         /* This struct is already zeroed for us (static global) */
554         for (i = 0; i < class_devno_max(); i++)
555                 obd_devs[i] = NULL;
556
557         /* Default the dirty page cache cap to 1/2 of system memory.
558          * For clients with less memory, a larger fraction is needed
559          * for other purposes (mostly for BGL). */
560         if (cfs_num_physpages <= 512 << (20 - CFS_PAGE_SHIFT))
561                 obd_max_dirty_pages = cfs_num_physpages / 4;
562         else
563                 obd_max_dirty_pages = cfs_num_physpages / 2;
564
565         err = obd_init_caches();
566         if (err)
567                 return err;
568 #ifdef __KERNEL__
569         err = class_procfs_init();
570         if (err)
571                 return err;
572 #endif
573
574         err = lu_global_init();
575         if (err)
576                 return err;
577
578 #ifdef __KERNEL__
579         err = lustre_register_fs();
580 #endif
581
582         return err;
583 }
584
585 /* liblustre doesn't call cleanup_obdclass, apparently.  we carry on in this
586  * ifdef to the end of the file to cover module and versioning goo.*/
587 #ifdef __KERNEL__
588 static void cleanup_obdclass(void)
589 {
590         int i;
591         int lustre_unregister_fs(void);
592         __u64 memory_leaked, pages_leaked;
593         __u64 memory_max, pages_max;
594         ENTRY;
595
596         lustre_unregister_fs();
597
598         cfs_psdev_deregister(&obd_psdev);
599         for (i = 0; i < class_devno_max(); i++) {
600                 struct obd_device *obd = class_num2obd(i);
601                 if (obd && obd->obd_set_up &&
602                     OBT(obd) && OBP(obd, detach)) {
603                         /* XXX should this call generic detach otherwise? */
604                         LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
605                         OBP(obd, detach)(obd);
606                 }
607         }
608         lu_global_fini();
609
610         obd_cleanup_caches();
611         obd_sysctl_clean();
612
613         class_procfs_clean();
614
615         class_handle_cleanup();
616         class_exit_uuidlist();
617         obd_zombie_impexp_stop();
618
619         memory_leaked = obd_memory_sum();
620         pages_leaked = obd_pages_sum();
621
622         memory_max = obd_memory_max();
623         pages_max = obd_pages_max();
624
625         lprocfs_free_stats(&obd_memory);
626         CDEBUG((memory_leaked) ? D_ERROR : D_INFO,
627                "obd_memory max: "LPU64", leaked: "LPU64"\n",
628                memory_max, memory_leaked);
629         CDEBUG((pages_leaked) ? D_ERROR : D_INFO,
630                "obd_memory_pages max: "LPU64", leaked: "LPU64"\n",
631                pages_max, pages_leaked);
632
633         EXIT;
634 }
635
636 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
637 MODULE_DESCRIPTION("Lustre Class Driver Build Version: " BUILD_VERSION);
638 MODULE_LICENSE("GPL");
639
640 cfs_module(obdclass, LUSTRE_VERSION_STRING, init_obdclass, cleanup_obdclass);
641 #endif