1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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
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
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
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>
44 # define EXPORT_SYMTAB
46 #define DEBUG_SUBSYSTEM S_MDS
48 #include <linux/module.h>
51 #include <obd_class.h>
52 #include <lprocfs_status.h>
53 #include <lustre_ver.h>
54 #include "cmm_internal.h"
55 #include "mdc_internal.h"
56 #ifdef HAVE_QUOTA_SUPPORT
57 # include <lustre_quota.h>
60 struct obd_ops cmm_obd_device_ops = {
61 .o_owner = THIS_MODULE
64 static const struct lu_device_operations cmm_lu_ops;
66 static inline int lu_device_is_cmm(struct lu_device *d)
68 return ergo(d != NULL && d->ld_ops != NULL, d->ld_ops == &cmm_lu_ops);
71 int cmm_root_get(const struct lu_env *env, struct md_device *md,
74 struct cmm_device *cmm_dev = md2cmm_dev(md);
75 /* valid only on master MDS */
76 if (cmm_dev->cmm_local_num == 0)
77 return cmm_child_ops(cmm_dev)->mdo_root_get(env,
78 cmm_dev->cmm_child, fid);
83 static int cmm_statfs(const struct lu_env *env, struct md_device *md,
86 struct cmm_device *cmm_dev = md2cmm_dev(md);
90 rc = cmm_child_ops(cmm_dev)->mdo_statfs(env,
91 cmm_dev->cmm_child, sfs);
95 static int cmm_maxsize_get(const struct lu_env *env, struct md_device *md,
96 int *md_size, int *cookie_size)
98 struct cmm_device *cmm_dev = md2cmm_dev(md);
101 rc = cmm_child_ops(cmm_dev)->mdo_maxsize_get(env, cmm_dev->cmm_child,
102 md_size, cookie_size);
106 static int cmm_init_capa_ctxt(const struct lu_env *env, struct md_device *md,
107 int mode , unsigned long timeout, __u32 alg,
108 struct lustre_capa_key *keys)
110 struct cmm_device *cmm_dev = md2cmm_dev(md);
113 LASSERT(cmm_child_ops(cmm_dev)->mdo_init_capa_ctxt);
114 rc = cmm_child_ops(cmm_dev)->mdo_init_capa_ctxt(env, cmm_dev->cmm_child,
120 static int cmm_update_capa_key(const struct lu_env *env,
121 struct md_device *md,
122 struct lustre_capa_key *key)
124 struct cmm_device *cmm_dev = md2cmm_dev(md);
127 rc = cmm_child_ops(cmm_dev)->mdo_update_capa_key(env,
133 static int cmm_llog_ctxt_get(const struct lu_env *env, struct md_device *m,
136 struct cmm_device *cmm_dev = md2cmm_dev(m);
140 rc = cmm_child_ops(cmm_dev)->mdo_llog_ctxt_get(env, cmm_dev->cmm_child,
145 #ifdef HAVE_QUOTA_SUPPORT
146 static int cmm_quota_notify(const struct lu_env *env, struct md_device *m)
148 struct cmm_device *cmm_dev = md2cmm_dev(m);
152 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_notify(env,
157 static int cmm_quota_setup(const struct lu_env *env, struct md_device *m,
160 struct cmm_device *cmm_dev = md2cmm_dev(m);
164 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_setup(env,
170 static int cmm_quota_cleanup(const struct lu_env *env, struct md_device *m)
172 struct cmm_device *cmm_dev = md2cmm_dev(m);
176 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_cleanup(env,
181 static int cmm_quota_recovery(const struct lu_env *env, struct md_device *m)
183 struct cmm_device *cmm_dev = md2cmm_dev(m);
187 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_recovery(env,
192 static int cmm_quota_check(const struct lu_env *env, struct md_device *m,
193 struct obd_export *exp, __u32 type)
195 struct cmm_device *cmm_dev = md2cmm_dev(m);
199 /* disable quota for CMD case temporary. */
200 if (cmm_dev->cmm_tgt_count)
203 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_check(env,
209 static int cmm_quota_on(const struct lu_env *env, struct md_device *m,
212 struct cmm_device *cmm_dev = md2cmm_dev(m);
216 /* disable quota for CMD case temporary. */
217 if (cmm_dev->cmm_tgt_count)
220 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_on(env,
226 static int cmm_quota_off(const struct lu_env *env, struct md_device *m,
229 struct cmm_device *cmm_dev = md2cmm_dev(m);
233 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_off(env,
239 static int cmm_quota_setinfo(const struct lu_env *env, struct md_device *m,
240 __u32 type, __u32 id, struct obd_dqinfo *dqinfo)
242 struct cmm_device *cmm_dev = md2cmm_dev(m);
246 /* disable quota for CMD case temporary. */
247 if (cmm_dev->cmm_tgt_count)
250 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_setinfo(env,
256 static int cmm_quota_getinfo(const struct lu_env *env,
257 const struct md_device *m,
258 __u32 type, __u32 id, struct obd_dqinfo *dqinfo)
260 struct cmm_device *cmm_dev = md2cmm_dev((struct md_device *)m);
264 /* disable quota for CMD case temporary. */
265 if (cmm_dev->cmm_tgt_count)
268 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_getinfo(env,
274 static int cmm_quota_setquota(const struct lu_env *env, struct md_device *m,
275 __u32 type, __u32 id, struct obd_dqblk *dqblk)
277 struct cmm_device *cmm_dev = md2cmm_dev(m);
281 /* disable quota for CMD case temporary. */
282 if (cmm_dev->cmm_tgt_count)
285 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_setquota(env,
291 static int cmm_quota_getquota(const struct lu_env *env,
292 const struct md_device *m,
293 __u32 type, __u32 id, struct obd_dqblk *dqblk)
295 struct cmm_device *cmm_dev = md2cmm_dev((struct md_device *)m);
299 /* disable quota for CMD case temporary. */
300 if (cmm_dev->cmm_tgt_count)
303 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_getquota(env,
309 static int cmm_quota_getoinfo(const struct lu_env *env,
310 const struct md_device *m,
311 __u32 type, __u32 id, struct obd_dqinfo *dqinfo)
313 struct cmm_device *cmm_dev = md2cmm_dev((struct md_device *)m);
317 /* disable quota for CMD case temporary. */
318 if (cmm_dev->cmm_tgt_count)
321 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_getoinfo(env,
327 static int cmm_quota_getoquota(const struct lu_env *env,
328 const struct md_device *m,
329 __u32 type, __u32 id, struct obd_dqblk *dqblk)
331 struct cmm_device *cmm_dev = md2cmm_dev((struct md_device *)m);
335 /* disable quota for CMD case temporary. */
336 if (cmm_dev->cmm_tgt_count)
339 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_getoquota(env,
345 static int cmm_quota_invalidate(const struct lu_env *env, struct md_device *m,
348 struct cmm_device *cmm_dev = md2cmm_dev(m);
352 /* disable quota for CMD case temporary. */
353 if (cmm_dev->cmm_tgt_count)
356 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_invalidate(env,
362 static int cmm_quota_finvalidate(const struct lu_env *env, struct md_device *m,
365 struct cmm_device *cmm_dev = md2cmm_dev(m);
369 /* disable quota for CMD case temporary. */
370 if (cmm_dev->cmm_tgt_count)
373 rc = cmm_child_ops(cmm_dev)->mdo_quota.mqo_finvalidate(env,
380 int cmm_iocontrol(const struct lu_env *env, struct md_device *m,
381 unsigned int cmd, int len, void *data)
383 struct md_device *next = md2cmm_dev(m)->cmm_child;
387 rc = next->md_ops->mdo_iocontrol(env, next, cmd, len, data);
392 static const struct md_device_operations cmm_md_ops = {
393 .mdo_statfs = cmm_statfs,
394 .mdo_root_get = cmm_root_get,
395 .mdo_maxsize_get = cmm_maxsize_get,
396 .mdo_init_capa_ctxt = cmm_init_capa_ctxt,
397 .mdo_update_capa_key = cmm_update_capa_key,
398 .mdo_llog_ctxt_get = cmm_llog_ctxt_get,
399 .mdo_iocontrol = cmm_iocontrol,
400 #ifdef HAVE_QUOTA_SUPPORT
402 .mqo_notify = cmm_quota_notify,
403 .mqo_setup = cmm_quota_setup,
404 .mqo_cleanup = cmm_quota_cleanup,
405 .mqo_recovery = cmm_quota_recovery,
406 .mqo_check = cmm_quota_check,
407 .mqo_on = cmm_quota_on,
408 .mqo_off = cmm_quota_off,
409 .mqo_setinfo = cmm_quota_setinfo,
410 .mqo_getinfo = cmm_quota_getinfo,
411 .mqo_setquota = cmm_quota_setquota,
412 .mqo_getquota = cmm_quota_getquota,
413 .mqo_getoinfo = cmm_quota_getoinfo,
414 .mqo_getoquota = cmm_quota_getoquota,
415 .mqo_invalidate = cmm_quota_invalidate,
416 .mqo_finvalidate = cmm_quota_finvalidate
421 extern struct lu_device_type mdc_device_type;
423 static int cmm_post_init_mdc(const struct lu_env *env,
424 struct cmm_device *cmm)
426 int max_mdsize, max_cookiesize, rc;
427 struct mdc_device *mc, *tmp;
429 /* get the max mdsize and cookiesize from lower layer */
430 rc = cmm_maxsize_get(env, &cmm->cmm_md_dev, &max_mdsize,
435 spin_lock(&cmm->cmm_tgt_guard);
436 list_for_each_entry_safe(mc, tmp, &cmm->cmm_targets,
438 cmm_mdc_init_ea_size(env, mc, max_mdsize, max_cookiesize);
440 spin_unlock(&cmm->cmm_tgt_guard);
444 /* --- cmm_lu_operations --- */
445 /* add new MDC to the CMM, create MDC lu_device and connect it to mdc_obd */
446 static int cmm_add_mdc(const struct lu_env *env,
447 struct cmm_device *cm, struct lustre_cfg *cfg)
449 struct lu_device_type *ldt = &mdc_device_type;
450 char *p, *num = lustre_cfg_string(cfg, 2);
451 struct mdc_device *mc, *tmp;
452 struct lu_fld_target target;
453 struct lu_device *ld;
454 struct lu_device *cmm_lu = cmm2lu_dev(cm);
456 struct lu_site *site = cmm2lu_dev(cm)->ld_site;
458 #ifdef HAVE_QUOTA_SUPPORT
463 /* find out that there is no such mdc */
465 mdc_num = simple_strtol(num, &p, 10);
467 CERROR("Invalid index in lustre_cgf, offset 2\n");
471 spin_lock(&cm->cmm_tgt_guard);
472 list_for_each_entry_safe(mc, tmp, &cm->cmm_targets,
474 if (mc->mc_num == mdc_num) {
475 spin_unlock(&cm->cmm_tgt_guard);
479 spin_unlock(&cm->cmm_tgt_guard);
480 ld = ldt->ldt_ops->ldto_device_alloc(env, ldt, cfg);
486 rc = ldt->ldt_ops->ldto_device_init(env, ld, NULL, NULL);
488 ldt->ldt_ops->ldto_device_free(env, ld);
491 /* pass config to the just created MDC */
492 rc = ld->ld_ops->ldo_process_config(env, ld, cfg);
494 ldt->ldt_ops->ldto_device_fini(env, ld);
495 ldt->ldt_ops->ldto_device_free(env, ld);
499 spin_lock(&cm->cmm_tgt_guard);
500 list_for_each_entry_safe(mc, tmp, &cm->cmm_targets,
502 if (mc->mc_num == mdc_num) {
503 spin_unlock(&cm->cmm_tgt_guard);
504 ldt->ldt_ops->ldto_device_fini(env, ld);
505 ldt->ldt_ops->ldto_device_free(env, ld);
510 list_add_tail(&mc->mc_linkage, &cm->cmm_targets);
512 #ifdef HAVE_QUOTA_SUPPORT
513 first = cm->cmm_tgt_count;
515 spin_unlock(&cm->cmm_tgt_guard);
517 lu_device_get(cmm_lu);
518 lu_ref_add(&cmm_lu->ld_reference, "mdc-child", ld);
520 target.ft_srv = NULL;
521 target.ft_idx = mc->mc_num;
522 target.ft_exp = mc->mc_desc.cl_exp;
523 fld_client_add_target(cm->cmm_fld, &target);
525 if (mc->mc_num == 0) {
526 /* this is mdt0 -> mc export, fld lookup need this export
527 to forward fld lookup request. */
528 LASSERT(!lu_site2md(site)->ms_server_fld->lsf_control_exp);
529 lu_site2md(site)->ms_server_fld->lsf_control_exp =
532 #ifdef HAVE_QUOTA_SUPPORT
533 /* XXX: Disable quota for CMD case temporary. */
535 CWARN("Disable quota for CMD case temporary!\n");
536 cmm_child_ops(cm)->mdo_quota.mqo_off(env, cm->cmm_child, UGQUOTA);
539 /* Set max md size for the mdc. */
540 rc = cmm_post_init_mdc(env, cm);
544 static void cmm_device_shutdown(const struct lu_env *env,
545 struct cmm_device *cm,
546 struct lustre_cfg *cfg)
548 struct mdc_device *mc, *tmp;
551 /* Remove local target from FLD. */
552 fld_client_del_target(cm->cmm_fld, cm->cmm_local_num);
554 /* Finish all mdc devices. */
555 spin_lock(&cm->cmm_tgt_guard);
556 list_for_each_entry_safe(mc, tmp, &cm->cmm_targets, mc_linkage) {
557 struct lu_device *ld_m = mdc2lu_dev(mc);
558 fld_client_del_target(cm->cmm_fld, mc->mc_num);
559 ld_m->ld_ops->ldo_process_config(env, ld_m, cfg);
561 spin_unlock(&cm->cmm_tgt_guard);
563 /* remove upcall device*/
564 md_upcall_fini(&cm->cmm_md_dev);
569 static int cmm_device_mount(const struct lu_env *env,
570 struct cmm_device *m, struct lustre_cfg *cfg)
572 const char *index = lustre_cfg_string(cfg, 2);
575 LASSERT(index != NULL);
577 m->cmm_local_num = simple_strtol(index, &p, 10);
579 CERROR("Invalid index in lustre_cgf\n");
586 static int cmm_process_config(const struct lu_env *env,
587 struct lu_device *d, struct lustre_cfg *cfg)
589 struct cmm_device *m = lu2cmm_dev(d);
590 struct lu_device *next = md2lu_dev(m->cmm_child);
594 switch(cfg->lcfg_command) {
596 /* On first ADD_MDC add also local target. */
597 if (!(m->cmm_flags & CMM_INITIALIZED)) {
598 struct lu_site *ls = cmm2lu_dev(m)->ld_site;
599 struct lu_fld_target target;
601 target.ft_srv = lu_site2md(ls)->ms_server_fld;
602 target.ft_idx = m->cmm_local_num;
603 target.ft_exp = NULL;
605 fld_client_add_target(m->cmm_fld, &target);
607 err = cmm_add_mdc(env, m, cfg);
609 /* The first ADD_MDC can be counted as setup is finished. */
610 if (!(m->cmm_flags & CMM_INITIALIZED))
611 m->cmm_flags |= CMM_INITIALIZED;
616 /* lower layers should be set up at first */
617 err = next->ld_ops->ldo_process_config(env, next, cfg);
619 err = cmm_device_mount(env, m, cfg);
624 cmm_device_shutdown(env, m, cfg);
627 err = next->ld_ops->ldo_process_config(env, next, cfg);
632 static int cmm_recovery_complete(const struct lu_env *env,
635 struct cmm_device *m = lu2cmm_dev(d);
636 struct lu_device *next = md2lu_dev(m->cmm_child);
639 rc = next->ld_ops->ldo_recovery_complete(env, next);
643 static int cmm_prepare(const struct lu_env *env,
644 struct lu_device *pdev,
645 struct lu_device *dev)
647 struct cmm_device *cmm = lu2cmm_dev(dev);
648 struct lu_device *next = md2lu_dev(cmm->cmm_child);
652 rc = next->ld_ops->ldo_prepare(env, dev, next);
656 static const struct lu_device_operations cmm_lu_ops = {
657 .ldo_object_alloc = cmm_object_alloc,
658 .ldo_process_config = cmm_process_config,
659 .ldo_recovery_complete = cmm_recovery_complete,
660 .ldo_prepare = cmm_prepare,
663 /* --- lu_device_type operations --- */
664 int cmm_upcall(const struct lu_env *env, struct md_device *md,
665 enum md_upcall_event ev)
672 rc = cmm_post_init_mdc(env, md2cmm_dev(md));
674 CERROR("can not init md size %d\n", rc);
677 rc = md_do_upcall(env, md, ev);
682 static struct lu_device *cmm_device_free(const struct lu_env *env,
685 struct cmm_device *m = lu2cmm_dev(d);
686 struct lu_device *next = md2lu_dev(m->cmm_child);
689 LASSERT(m->cmm_tgt_count == 0);
690 LASSERT(list_empty(&m->cmm_targets));
691 if (m->cmm_fld != NULL) {
692 OBD_FREE_PTR(m->cmm_fld);
695 md_device_fini(&m->cmm_md_dev);
700 static struct lu_device *cmm_device_alloc(const struct lu_env *env,
701 struct lu_device_type *t,
702 struct lustre_cfg *cfg)
705 struct cmm_device *m;
710 l = ERR_PTR(-ENOMEM);
712 md_device_init(&m->cmm_md_dev, t);
713 m->cmm_md_dev.md_ops = &cmm_md_ops;
714 md_upcall_init(&m->cmm_md_dev, cmm_upcall);
716 l->ld_ops = &cmm_lu_ops;
718 OBD_ALLOC_PTR(m->cmm_fld);
720 cmm_device_free(env, l);
721 l = ERR_PTR(-ENOMEM);
727 /* context key constructor/destructor: cmm_key_init, cmm_key_fini */
728 LU_KEY_INIT_FINI(cmm, struct cmm_thread_info);
730 /* context key: cmm_thread_key */
731 LU_CONTEXT_KEY_DEFINE(cmm, LCT_MD_THREAD);
733 struct cmm_thread_info *cmm_env_info(const struct lu_env *env)
735 struct cmm_thread_info *info;
737 info = lu_context_key_get(&env->le_ctx, &cmm_thread_key);
738 LASSERT(info != NULL);
742 /* type constructor/destructor: cmm_type_init/cmm_type_fini */
743 LU_TYPE_INIT_FINI(cmm, &cmm_thread_key);
746 * Kludge code : it should be moved mdc_device.c if mdc_(mds)_device
749 static int __cmm_type_init(struct lu_device_type *t)
752 rc = lu_device_type_init(&mdc_device_type);
754 rc = cmm_type_init(t);
756 lu_device_type_fini(&mdc_device_type);
761 static void __cmm_type_fini(struct lu_device_type *t)
763 lu_device_type_fini(&mdc_device_type);
767 static void __cmm_type_start(struct lu_device_type *t)
769 mdc_device_type.ldt_ops->ldto_start(&mdc_device_type);
773 static void __cmm_type_stop(struct lu_device_type *t)
775 mdc_device_type.ldt_ops->ldto_stop(&mdc_device_type);
779 static int cmm_device_init(const struct lu_env *env, struct lu_device *d,
780 const char *name, struct lu_device *next)
782 struct cmm_device *m = lu2cmm_dev(d);
787 spin_lock_init(&m->cmm_tgt_guard);
788 CFS_INIT_LIST_HEAD(&m->cmm_targets);
789 m->cmm_tgt_count = 0;
790 m->cmm_child = lu2md_dev(next);
792 err = fld_client_init(m->cmm_fld, name,
793 LUSTRE_CLI_FLD_HASH_DHT);
795 CERROR("Can't init FLD, err %d\n", err);
799 /* Assign site's fld client ref, needed for asserts in osd. */
800 ls = cmm2lu_dev(m)->ld_site;
801 lu_site2md(ls)->ms_client_fld = m->cmm_fld;
802 err = cmm_procfs_init(m, name);
807 static struct lu_device *cmm_device_fini(const struct lu_env *env,
808 struct lu_device *ld)
810 struct cmm_device *cm = lu2cmm_dev(ld);
811 struct mdc_device *mc, *tmp;
815 /* Finish all mdc devices */
816 spin_lock(&cm->cmm_tgt_guard);
817 list_for_each_entry_safe(mc, tmp, &cm->cmm_targets, mc_linkage) {
818 struct lu_device *ld_m = mdc2lu_dev(mc);
819 struct lu_device *ld_c = cmm2lu_dev(cm);
821 list_del_init(&mc->mc_linkage);
822 lu_ref_del(&ld_c->ld_reference, "mdc-child", ld_m);
824 ld_m->ld_type->ldt_ops->ldto_device_fini(env, ld_m);
825 ld_m->ld_type->ldt_ops->ldto_device_free(env, ld_m);
828 spin_unlock(&cm->cmm_tgt_guard);
830 fld_client_fini(cm->cmm_fld);
831 ls = cmm2lu_dev(cm)->ld_site;
832 lu_site2md(ls)->ms_client_fld = NULL;
835 RETURN (md2lu_dev(cm->cmm_child));
838 static struct lu_device_type_operations cmm_device_type_ops = {
839 .ldto_init = __cmm_type_init,
840 .ldto_fini = __cmm_type_fini,
842 .ldto_start = __cmm_type_start,
843 .ldto_stop = __cmm_type_stop,
845 .ldto_device_alloc = cmm_device_alloc,
846 .ldto_device_free = cmm_device_free,
848 .ldto_device_init = cmm_device_init,
849 .ldto_device_fini = cmm_device_fini
852 static struct lu_device_type cmm_device_type = {
853 .ldt_tags = LU_DEVICE_MD,
854 .ldt_name = LUSTRE_CMM_NAME,
855 .ldt_ops = &cmm_device_type_ops,
856 .ldt_ctx_tags = LCT_MD_THREAD | LCT_DT_THREAD
859 struct lprocfs_vars lprocfs_cmm_obd_vars[] = {
863 struct lprocfs_vars lprocfs_cmm_module_vars[] = {
867 static void lprocfs_cmm_init_vars(struct lprocfs_static_vars *lvars)
869 lvars->module_vars = lprocfs_cmm_module_vars;
870 lvars->obd_vars = lprocfs_cmm_obd_vars;
873 static int __init cmm_mod_init(void)
875 struct lprocfs_static_vars lvars;
877 lprocfs_cmm_init_vars(&lvars);
878 return class_register_type(&cmm_obd_device_ops, NULL, lvars.module_vars,
879 LUSTRE_CMM_NAME, &cmm_device_type);
882 static void __exit cmm_mod_exit(void)
884 class_unregister_type(LUSTRE_CMM_NAME);
887 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
888 MODULE_DESCRIPTION("Lustre Clustered Metadata Manager ("LUSTRE_CMM_NAME")");
889 MODULE_LICENSE("GPL");
891 cfs_module(cmm, "0.1.0", cmm_mod_init, cmm_mod_exit);