4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
30 * Copyright (c) 2011, Whamcloud, Inc.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/cmm/cmm_device.c
38 * Lustre Cluster Metadata Manager (cmm)
40 * Author: Mike Pershin <tappro@clusterfs.com>
47 #define DEBUG_SUBSYSTEM S_MDS
49 #include <linux/module.h>
52 #include <obd_class.h>
53 #include <lprocfs_status.h>
54 #include <lustre_ver.h>
55 #include "cmm_internal.h"
56 #include "mdc_internal.h"
57 #ifdef HAVE_QUOTA_SUPPORT
58 # include <lustre_quota.h>
61 struct obd_ops cmm_obd_device_ops = {
62 .o_owner = THIS_MODULE
65 static const struct lu_device_operations cmm_lu_ops;
67 static inline int lu_device_is_cmm(struct lu_device *d)
69 return ergo(d != NULL && d->ld_ops != NULL, d->ld_ops == &cmm_lu_ops);
72 int cmm_root_get(const struct lu_env *env, struct md_device *md,
75 struct cmm_device *cmm_dev = md2cmm_dev(md);
76 /* valid only on master MDS */
77 if (cmm_dev->cmm_local_num == 0)
78 return cmm_child_ops(cmm_dev)->mdo_root_get(env,
79 cmm_dev->cmm_child, fid);
84 static int cmm_statfs(const struct lu_env *env, struct md_device *md,
85 struct obd_statfs *sfs)
87 struct cmm_device *cmm_dev = md2cmm_dev(md);
91 rc = cmm_child_ops(cmm_dev)->mdo_statfs(env,
92 cmm_dev->cmm_child, sfs);
96 static int cmm_maxsize_get(const struct lu_env *env, struct md_device *md,
97 int *md_size, int *cookie_size)
99 struct cmm_device *cmm_dev = md2cmm_dev(md);
102 rc = cmm_child_ops(cmm_dev)->mdo_maxsize_get(env, cmm_dev->cmm_child,
103 md_size, cookie_size);
107 static int cmm_init_capa_ctxt(const struct lu_env *env, struct md_device *md,
108 int mode , unsigned long timeout, __u32 alg,
109 struct lustre_capa_key *keys)
111 struct cmm_device *cmm_dev = md2cmm_dev(md);
114 LASSERT(cmm_child_ops(cmm_dev)->mdo_init_capa_ctxt);
115 rc = cmm_child_ops(cmm_dev)->mdo_init_capa_ctxt(env, cmm_dev->cmm_child,
121 static int cmm_update_capa_key(const struct lu_env *env,
122 struct md_device *md,
123 struct lustre_capa_key *key)
125 struct cmm_device *cmm_dev = md2cmm_dev(md);
128 rc = cmm_child_ops(cmm_dev)->mdo_update_capa_key(env,
134 static int cmm_llog_ctxt_get(const struct lu_env *env, struct md_device *m,
137 struct cmm_device *cmm_dev = md2cmm_dev(m);
141 rc = cmm_child_ops(cmm_dev)->mdo_llog_ctxt_get(env, cmm_dev->cmm_child,
146 #ifdef HAVE_QUOTA_SUPPORT
148 * \name Quota functions
151 static int cmm_quota_notify(const struct lu_env *env, struct md_device *m)
153 struct cmm_device *cmm_dev = md2cmm_dev(m);
157 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_notify(env,
162 static int cmm_quota_setup(const struct lu_env *env, struct md_device *m,
165 struct cmm_device *cmm_dev = md2cmm_dev(m);
169 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_setup(env,
175 static int cmm_quota_cleanup(const struct lu_env *env, struct md_device *m)
177 struct cmm_device *cmm_dev = md2cmm_dev(m);
181 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_cleanup(env,
186 static int cmm_quota_recovery(const struct lu_env *env, struct md_device *m)
188 struct cmm_device *cmm_dev = md2cmm_dev(m);
192 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_recovery(env,
197 static int cmm_quota_check(const struct lu_env *env, struct md_device *m,
200 struct cmm_device *cmm_dev = md2cmm_dev(m);
204 /* disable quota for CMD case temporary. */
205 if (cmm_dev->cmm_tgt_count)
208 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_check(env,
214 static int cmm_quota_on(const struct lu_env *env, struct md_device *m,
217 struct cmm_device *cmm_dev = md2cmm_dev(m);
221 /* disable quota for CMD case temporary. */
222 if (cmm_dev->cmm_tgt_count)
225 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_on(env,
231 static int cmm_quota_off(const struct lu_env *env, struct md_device *m,
234 struct cmm_device *cmm_dev = md2cmm_dev(m);
238 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_off(env,
244 static int cmm_quota_setinfo(const struct lu_env *env, struct md_device *m,
245 __u32 type, __u32 id, struct obd_dqinfo *dqinfo)
247 struct cmm_device *cmm_dev = md2cmm_dev(m);
251 /* disable quota for CMD case temporary. */
252 if (cmm_dev->cmm_tgt_count)
255 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_setinfo(env,
261 static int cmm_quota_getinfo(const struct lu_env *env,
262 const struct md_device *m,
263 __u32 type, __u32 id, struct obd_dqinfo *dqinfo)
265 struct cmm_device *cmm_dev = md2cmm_dev((struct md_device *)m);
269 /* disable quota for CMD case temporary. */
270 if (cmm_dev->cmm_tgt_count)
273 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_getinfo(env,
279 static int cmm_quota_setquota(const struct lu_env *env, struct md_device *m,
280 __u32 type, __u32 id, struct obd_dqblk *dqblk)
282 struct cmm_device *cmm_dev = md2cmm_dev(m);
286 /* disable quota for CMD case temporary. */
287 if (cmm_dev->cmm_tgt_count)
290 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_setquota(env,
296 static int cmm_quota_getquota(const struct lu_env *env,
297 const struct md_device *m,
298 __u32 type, __u32 id, struct obd_dqblk *dqblk)
300 struct cmm_device *cmm_dev = md2cmm_dev((struct md_device *)m);
304 /* disable quota for CMD case temporary. */
305 if (cmm_dev->cmm_tgt_count)
308 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_getquota(env,
314 static int cmm_quota_getoinfo(const struct lu_env *env,
315 const struct md_device *m,
316 __u32 type, __u32 id, struct obd_dqinfo *dqinfo)
318 struct cmm_device *cmm_dev = md2cmm_dev((struct md_device *)m);
322 /* disable quota for CMD case temporary. */
323 if (cmm_dev->cmm_tgt_count)
326 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_getoinfo(env,
332 static int cmm_quota_getoquota(const struct lu_env *env,
333 const struct md_device *m,
334 __u32 type, __u32 id, struct obd_dqblk *dqblk)
336 struct cmm_device *cmm_dev = md2cmm_dev((struct md_device *)m);
340 /* disable quota for CMD case temporary. */
341 if (cmm_dev->cmm_tgt_count)
344 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_getoquota(env,
350 static int cmm_quota_invalidate(const struct lu_env *env, struct md_device *m,
353 struct cmm_device *cmm_dev = md2cmm_dev(m);
357 /* disable quota for CMD case temporary. */
358 if (cmm_dev->cmm_tgt_count)
361 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_invalidate(env,
367 static int cmm_quota_finvalidate(const struct lu_env *env, struct md_device *m,
370 struct cmm_device *cmm_dev = md2cmm_dev(m);
374 /* disable quota for CMD case temporary. */
375 if (cmm_dev->cmm_tgt_count)
378 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_finvalidate(env,
386 int cmm_iocontrol(const struct lu_env *env, struct md_device *m,
387 unsigned int cmd, int len, void *data)
389 struct md_device *next = md2cmm_dev(m)->cmm_child;
393 rc = next->md_ops->mdo_iocontrol(env, next, cmd, len, data);
398 static const struct md_device_operations cmm_md_ops = {
399 .mdo_statfs = cmm_statfs,
400 .mdo_root_get = cmm_root_get,
401 .mdo_maxsize_get = cmm_maxsize_get,
402 .mdo_init_capa_ctxt = cmm_init_capa_ctxt,
403 .mdo_update_capa_key = cmm_update_capa_key,
404 .mdo_llog_ctxt_get = cmm_llog_ctxt_get,
405 .mdo_iocontrol = cmm_iocontrol,
406 #ifdef HAVE_QUOTA_SUPPORT
408 .mqo_notify = cmm_quota_notify,
409 .mqo_setup = cmm_quota_setup,
410 .mqo_cleanup = cmm_quota_cleanup,
411 .mqo_recovery = cmm_quota_recovery,
412 .mqo_check = cmm_quota_check,
413 .mqo_on = cmm_quota_on,
414 .mqo_off = cmm_quota_off,
415 .mqo_setinfo = cmm_quota_setinfo,
416 .mqo_getinfo = cmm_quota_getinfo,
417 .mqo_setquota = cmm_quota_setquota,
418 .mqo_getquota = cmm_quota_getquota,
419 .mqo_getoinfo = cmm_quota_getoinfo,
420 .mqo_getoquota = cmm_quota_getoquota,
421 .mqo_invalidate = cmm_quota_invalidate,
422 .mqo_finvalidate = cmm_quota_finvalidate
427 extern struct lu_device_type mdc_device_type;
431 static int cmm_post_init_mdc(const struct lu_env *env,
432 struct cmm_device *cmm)
434 int max_mdsize, max_cookiesize, rc;
435 struct mdc_device *mc, *tmp;
437 /* get the max mdsize and cookiesize from lower layer */
438 rc = cmm_maxsize_get(env, &cmm->cmm_md_dev, &max_mdsize,
443 cfs_spin_lock(&cmm->cmm_tgt_guard);
444 cfs_list_for_each_entry_safe(mc, tmp, &cmm->cmm_targets,
446 cmm_mdc_init_ea_size(env, mc, max_mdsize, max_cookiesize);
448 cfs_spin_unlock(&cmm->cmm_tgt_guard);
452 /* --- cmm_lu_operations --- */
453 /* add new MDC to the CMM, create MDC lu_device and connect it to mdc_obd */
454 static int cmm_add_mdc(const struct lu_env *env,
455 struct cmm_device *cm, struct lustre_cfg *cfg)
457 struct lu_device_type *ldt = &mdc_device_type;
458 char *p, *num = lustre_cfg_string(cfg, 2);
459 struct mdc_device *mc, *tmp;
460 struct lu_fld_target target;
461 struct lu_device *ld;
462 struct lu_device *cmm_lu = cmm2lu_dev(cm);
464 struct lu_site *site = cmm2lu_dev(cm)->ld_site;
466 #ifdef HAVE_QUOTA_SUPPORT
471 /* find out that there is no such mdc */
473 mdc_num = simple_strtol(num, &p, 10);
475 CERROR("Invalid index in lustre_cgf, offset 2\n");
479 cfs_spin_lock(&cm->cmm_tgt_guard);
480 cfs_list_for_each_entry_safe(mc, tmp, &cm->cmm_targets,
482 if (mc->mc_num == mdc_num) {
483 cfs_spin_unlock(&cm->cmm_tgt_guard);
487 cfs_spin_unlock(&cm->cmm_tgt_guard);
488 ld = ldt->ldt_ops->ldto_device_alloc(env, ldt, cfg);
494 rc = ldt->ldt_ops->ldto_device_init(env, ld, NULL, NULL);
496 ldt->ldt_ops->ldto_device_free(env, ld);
499 /* pass config to the just created MDC */
500 rc = ld->ld_ops->ldo_process_config(env, ld, cfg);
502 ldt->ldt_ops->ldto_device_fini(env, ld);
503 ldt->ldt_ops->ldto_device_free(env, ld);
507 cfs_spin_lock(&cm->cmm_tgt_guard);
508 cfs_list_for_each_entry_safe(mc, tmp, &cm->cmm_targets,
510 if (mc->mc_num == mdc_num) {
511 cfs_spin_unlock(&cm->cmm_tgt_guard);
512 ldt->ldt_ops->ldto_device_fini(env, ld);
513 ldt->ldt_ops->ldto_device_free(env, ld);
518 cfs_list_add_tail(&mc->mc_linkage, &cm->cmm_targets);
520 #ifdef HAVE_QUOTA_SUPPORT
521 first = cm->cmm_tgt_count;
523 cfs_spin_unlock(&cm->cmm_tgt_guard);
525 lu_device_get(cmm_lu);
526 lu_ref_add(&cmm_lu->ld_reference, "mdc-child", ld);
528 target.ft_srv = NULL;
529 target.ft_idx = mc->mc_num;
530 target.ft_exp = mc->mc_desc.cl_exp;
531 fld_client_add_target(cm->cmm_fld, &target);
533 if (mc->mc_num == 0) {
534 /* this is mdt0 -> mc export, fld lookup need this export
535 to forward fld lookup request. */
536 LASSERT(!lu_site2md(site)->ms_server_fld->lsf_control_exp);
537 lu_site2md(site)->ms_server_fld->lsf_control_exp =
540 #ifdef HAVE_QUOTA_SUPPORT
541 /* XXX: Disable quota for CMD case temporary. */
543 CWARN("Disable quota for CMD case temporary!\n");
544 cmm_child_ops(cm)->mdo_quota.mqo_off(env, cm->cmm_child, UGQUOTA);
547 /* Set max md size for the mdc. */
548 rc = cmm_post_init_mdc(env, cm);
552 static void cmm_device_shutdown(const struct lu_env *env,
553 struct cmm_device *cm,
554 struct lustre_cfg *cfg)
556 struct mdc_device *mc, *tmp;
559 /* Remove local target from FLD. */
560 fld_client_del_target(cm->cmm_fld, cm->cmm_local_num);
562 /* Finish all mdc devices. */
563 cfs_spin_lock(&cm->cmm_tgt_guard);
564 cfs_list_for_each_entry_safe(mc, tmp, &cm->cmm_targets, mc_linkage) {
565 struct lu_device *ld_m = mdc2lu_dev(mc);
566 fld_client_del_target(cm->cmm_fld, mc->mc_num);
567 ld_m->ld_ops->ldo_process_config(env, ld_m, cfg);
569 cfs_spin_unlock(&cm->cmm_tgt_guard);
571 /* remove upcall device*/
572 md_upcall_fini(&cm->cmm_md_dev);
577 static int cmm_device_mount(const struct lu_env *env,
578 struct cmm_device *m, struct lustre_cfg *cfg)
580 const char *index = lustre_cfg_string(cfg, 2);
583 LASSERT(index != NULL);
585 m->cmm_local_num = simple_strtol(index, &p, 10);
587 CERROR("Invalid index in lustre_cgf\n");
594 static int cmm_process_config(const struct lu_env *env,
595 struct lu_device *d, struct lustre_cfg *cfg)
597 struct cmm_device *m = lu2cmm_dev(d);
598 struct lu_device *next = md2lu_dev(m->cmm_child);
602 switch(cfg->lcfg_command) {
604 /* On first ADD_MDC add also local target. */
605 if (!(m->cmm_flags & CMM_INITIALIZED)) {
606 struct lu_site *ls = cmm2lu_dev(m)->ld_site;
607 struct lu_fld_target target;
609 target.ft_srv = lu_site2md(ls)->ms_server_fld;
610 target.ft_idx = m->cmm_local_num;
611 target.ft_exp = NULL;
613 fld_client_add_target(m->cmm_fld, &target);
615 err = cmm_add_mdc(env, m, cfg);
617 /* The first ADD_MDC can be counted as setup is finished. */
618 if (!(m->cmm_flags & CMM_INITIALIZED))
619 m->cmm_flags |= CMM_INITIALIZED;
624 /* lower layers should be set up at first */
625 err = next->ld_ops->ldo_process_config(env, next, cfg);
627 err = cmm_device_mount(env, m, cfg);
632 lu_dev_del_linkage(d->ld_site, d);
633 cmm_device_shutdown(env, m, cfg);
636 err = next->ld_ops->ldo_process_config(env, next, cfg);
641 static int cmm_recovery_complete(const struct lu_env *env,
644 struct cmm_device *m = lu2cmm_dev(d);
645 struct lu_device *next = md2lu_dev(m->cmm_child);
648 rc = next->ld_ops->ldo_recovery_complete(env, next);
652 static int cmm_prepare(const struct lu_env *env,
653 struct lu_device *pdev,
654 struct lu_device *dev)
656 struct cmm_device *cmm = lu2cmm_dev(dev);
657 struct lu_device *next = md2lu_dev(cmm->cmm_child);
661 rc = next->ld_ops->ldo_prepare(env, dev, next);
665 static const struct lu_device_operations cmm_lu_ops = {
666 .ldo_object_alloc = cmm_object_alloc,
667 .ldo_process_config = cmm_process_config,
668 .ldo_recovery_complete = cmm_recovery_complete,
669 .ldo_prepare = cmm_prepare,
672 /* --- lu_device_type operations --- */
673 int cmm_upcall(const struct lu_env *env, struct md_device *md,
674 enum md_upcall_event ev, void *data)
681 rc = cmm_post_init_mdc(env, md2cmm_dev(md));
683 CERROR("can not init md size %d\n", rc);
686 rc = md_do_upcall(env, md, ev, data);
691 static struct lu_device *cmm_device_free(const struct lu_env *env,
694 struct cmm_device *m = lu2cmm_dev(d);
695 struct lu_device *next = md2lu_dev(m->cmm_child);
698 LASSERT(m->cmm_tgt_count == 0);
699 LASSERT(cfs_list_empty(&m->cmm_targets));
700 if (m->cmm_fld != NULL) {
701 OBD_FREE_PTR(m->cmm_fld);
704 md_device_fini(&m->cmm_md_dev);
709 static struct lu_device *cmm_device_alloc(const struct lu_env *env,
710 struct lu_device_type *t,
711 struct lustre_cfg *cfg)
714 struct cmm_device *m;
719 l = ERR_PTR(-ENOMEM);
721 md_device_init(&m->cmm_md_dev, t);
722 m->cmm_md_dev.md_ops = &cmm_md_ops;
723 md_upcall_init(&m->cmm_md_dev, cmm_upcall);
725 l->ld_ops = &cmm_lu_ops;
727 OBD_ALLOC_PTR(m->cmm_fld);
729 cmm_device_free(env, l);
730 l = ERR_PTR(-ENOMEM);
736 /* context key constructor/destructor: cmm_key_init, cmm_key_fini */
737 LU_KEY_INIT_FINI(cmm, struct cmm_thread_info);
739 /* context key: cmm_thread_key */
740 LU_CONTEXT_KEY_DEFINE(cmm, LCT_MD_THREAD);
742 struct cmm_thread_info *cmm_env_info(const struct lu_env *env)
744 struct cmm_thread_info *info;
746 info = lu_context_key_get(&env->le_ctx, &cmm_thread_key);
747 LASSERT(info != NULL);
751 /* type constructor/destructor: cmm_type_init/cmm_type_fini */
752 LU_TYPE_INIT_FINI(cmm, &cmm_thread_key);
755 * Kludge code : it should be moved mdc_device.c if mdc_(mds)_device
758 static int __cmm_type_init(struct lu_device_type *t)
761 rc = lu_device_type_init(&mdc_device_type);
763 rc = cmm_type_init(t);
765 lu_device_type_fini(&mdc_device_type);
770 static void __cmm_type_fini(struct lu_device_type *t)
772 lu_device_type_fini(&mdc_device_type);
776 static void __cmm_type_start(struct lu_device_type *t)
778 mdc_device_type.ldt_ops->ldto_start(&mdc_device_type);
782 static void __cmm_type_stop(struct lu_device_type *t)
784 mdc_device_type.ldt_ops->ldto_stop(&mdc_device_type);
788 static int cmm_device_init(const struct lu_env *env, struct lu_device *d,
789 const char *name, struct lu_device *next)
791 struct cmm_device *m = lu2cmm_dev(d);
796 cfs_spin_lock_init(&m->cmm_tgt_guard);
797 CFS_INIT_LIST_HEAD(&m->cmm_targets);
798 m->cmm_tgt_count = 0;
799 m->cmm_child = lu2md_dev(next);
801 err = fld_client_init(m->cmm_fld, name,
802 LUSTRE_CLI_FLD_HASH_DHT);
804 CERROR("Can't init FLD, err %d\n", err);
808 /* Assign site's fld client ref, needed for asserts in osd. */
809 ls = cmm2lu_dev(m)->ld_site;
810 lu_site2md(ls)->ms_client_fld = m->cmm_fld;
811 err = cmm_procfs_init(m, name);
816 static struct lu_device *cmm_device_fini(const struct lu_env *env,
817 struct lu_device *ld)
819 struct cmm_device *cm = lu2cmm_dev(ld);
820 struct mdc_device *mc, *tmp;
824 /* Finish all mdc devices */
825 cfs_spin_lock(&cm->cmm_tgt_guard);
826 cfs_list_for_each_entry_safe(mc, tmp, &cm->cmm_targets, mc_linkage) {
827 struct lu_device *ld_m = mdc2lu_dev(mc);
828 struct lu_device *ld_c = cmm2lu_dev(cm);
830 cfs_list_del_init(&mc->mc_linkage);
831 lu_ref_del(&ld_c->ld_reference, "mdc-child", ld_m);
833 ld_m->ld_type->ldt_ops->ldto_device_fini(env, ld_m);
834 ld_m->ld_type->ldt_ops->ldto_device_free(env, ld_m);
837 cfs_spin_unlock(&cm->cmm_tgt_guard);
839 fld_client_proc_fini(cm->cmm_fld);
840 fld_client_fini(cm->cmm_fld);
841 ls = cmm2lu_dev(cm)->ld_site;
842 lu_site2md(ls)->ms_client_fld = NULL;
845 RETURN (md2lu_dev(cm->cmm_child));
848 static struct lu_device_type_operations cmm_device_type_ops = {
849 .ldto_init = __cmm_type_init,
850 .ldto_fini = __cmm_type_fini,
852 .ldto_start = __cmm_type_start,
853 .ldto_stop = __cmm_type_stop,
855 .ldto_device_alloc = cmm_device_alloc,
856 .ldto_device_free = cmm_device_free,
858 .ldto_device_init = cmm_device_init,
859 .ldto_device_fini = cmm_device_fini
862 static struct lu_device_type cmm_device_type = {
863 .ldt_tags = LU_DEVICE_MD,
864 .ldt_name = LUSTRE_CMM_NAME,
865 .ldt_ops = &cmm_device_type_ops,
866 .ldt_ctx_tags = LCT_MD_THREAD | LCT_DT_THREAD
869 struct lprocfs_vars lprocfs_cmm_obd_vars[] = {
873 struct lprocfs_vars lprocfs_cmm_module_vars[] = {
877 static void lprocfs_cmm_init_vars(struct lprocfs_static_vars *lvars)
879 lvars->module_vars = lprocfs_cmm_module_vars;
880 lvars->obd_vars = lprocfs_cmm_obd_vars;
884 static int __init cmm_mod_init(void)
886 struct lprocfs_static_vars lvars;
888 lprocfs_cmm_init_vars(&lvars);
889 return class_register_type(&cmm_obd_device_ops, NULL, lvars.module_vars,
890 LUSTRE_CMM_NAME, &cmm_device_type);
893 static void __exit cmm_mod_exit(void)
895 class_unregister_type(LUSTRE_CMM_NAME);
898 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
899 MODULE_DESCRIPTION("Lustre Clustered Metadata Manager ("LUSTRE_CMM_NAME")");
900 MODULE_LICENSE("GPL");
902 cfs_module(cmm, "0.1.0", cmm_mod_init, cmm_mod_exit);