Whamcloud - gitweb
mgs_handler mgs_fs_setup
[fs/lustre-release.git] / lustre / mgs / mgs_hander.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  lustre/mgs/mgs_handler.c
5  *  Lustre Management Server (mgs) request handler
6  *
7  *  Copyright (C) 2001-2005 Cluster File Systems, Inc.
8  *   Author Nathan <nathan@clusterfs.com>
9  *   Author LinSongTao <lincent@clusterfs.com>
10  *
11  *   This file is part of Lustre, http://www.lustre.org.
12  *
13  *   Lustre is free software; you can redistribute it and/or
14  *   modify it under the terms of version 2 of the GNU General Public
15  *   License as published by the Free Software Foundation.
16  *
17  *   Lustre is distributed in the hope that it will be useful,
18  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *   GNU General Public License for more details.
21  *
22  *   You should have received a copy of the GNU General Public License
23  *   along with Lustre; if not, write to the Free Software
24  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #ifndef EXPORT_SYMTAB
28 # define EXPORT_SYMTAB
29 #endif
30 #define DEBUG_SUBSYSTEM S_MGS
31
32 #ifdef __KERNEL__
33 # include <linux/module.h>
34 # include <linux/pagemap.h>
35 # include <linux/miscdevice.h>
36 # include <linux/init.h>
37 #else
38 # include <liblustre.h>
39 #endif
40
41 #include <linux/obd_class.h>
42 #include <linux/lustre_dlm.h>
43 #include <linux/lprocfs_status.h>
44 #include "mgs_internal.h"
45
46 /* Establish a connection to the MGS.*/
47 static int mgs_connect(struct lustre_handle *conn, struct obd_device *obd,
48                        struct obd_uuid *cluuid, struct obd_connect_data *data)
49 {
50         struct obd_export *exp;
51         struct mgs_export_data *med;
52         struct mgs_client_data *mcd;
53         int rc, abort_recovery;
54         ENTRY;
55
56         if (!conn || !obd || !cluuid)
57                 RETURN(-EINVAL);
58
59         /* Check for aborted recovery. */
60         spin_lock_bh(&obd->obd_processing_task_lock);
61         abort_recovery = obd->obd_abort_recovery;
62         spin_unlock_bh(&obd->obd_processing_task_lock);
63         if (abort_recovery)
64                 target_abort_recovery(obd);
65
66         rc = class_connect(conn, obd, cluuid);
67         if (rc)
68                 RETURN(rc);
69         exp = class_conn2export(conn);
70         LASSERT(exp);
71         med = &exp->exp_mgs_data;
72
73         if (data != NULL) {
74                 data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED;
75                 exp->exp_connect_flags = data->ocd_connect_flags;
76         }
77
78         OBD_ALLOC(mcd, sizeof(*mcd));
79         if (!mcd) {
80                 CERROR("mgs: out of memory for client data\n");
81                 GOTO(out, rc = -ENOMEM);
82         }
83
84         memcpy(mcd->mcd_uuid, cluuid, sizeof(mcd->mcd_uuid));
85         med->med_mcd = mcd;
86
87 out:
88         if (rc) {
89                 if (mcd) {
90                         OBD_FREE(mcd, sizeof(*mcd));
91                         med->med_mcd = NULL;
92                 }
93                 class_disconnect(exp);
94         } else {
95                 class_export_put(exp);
96         }
97
98         RETURN(rc);
99 }
100
101 static int mgs_init_export(struct obd_export *exp)
102 {
103         struct mgs_export_data *med = &exp->exp_mgs_data;
104
105         INIT_LIST_HEAD(&med->med_open_head);
106         spin_lock_init(&med->med_open_lock);
107         RETURN(0);
108 }
109
110 static int mgs_disconnect(struct obd_export *exp)
111 {
112         unsigned long irqflags;
113         int rc;
114         ENTRY;
115
116         LASSERT(exp);
117         class_export_get(exp);
118
119         /* Disconnect early so that clients can't keep using export */
120         rc = class_disconnect(exp);
121
122         /* complete all outstanding replies */
123         spin_lock_irqsave(&exp->exp_lock, irqflags);
124         while (!list_empty(&exp->exp_outstanding_replies)) {
125                 struct ptlrpc_reply_state *rs =
126                         list_entry(exp->exp_outstanding_replies.next,
127                                    struct ptlrpc_reply_state, rs_exp_list);
128                 struct ptlrpc_service *svc = rs->rs_service;
129
130                 spin_lock(&svc->srv_lock);
131                 list_del_init(&rs->rs_exp_list);
132                 ptlrpc_schedule_difficult_reply(rs);
133                 spin_unlock(&svc->srv_lock);
134         }
135         spin_unlock_irqrestore(&exp->exp_lock, irqflags);
136
137         class_export_put(exp);
138         RETURN(rc);
139 }
140
141 /* mount the file system (secretly) */
142 static int mgs_setup(struct obd_device *obd, obd_count len, void *buf)
143 {
144         struct lprocfs_static_vars lvars;
145         struct lustre_cfg* lcfg = buf;
146         char *options = NULL;
147         struct mgs_obd *mgs = &obd->u.mgs;
148         struct vfsmount *mnt;
149         unsigned long page;
150         int rc = 0;
151         ENTRY;
152
153         /* setup 1:/dev/loop/0 2:ext3 3:mgs 4:errors=remount-ro,iopen_nopriv*/
154
155         if (lcfg->lcfg_bufcount < 3)
156                 RETURN(rc = -EINVAL)
157
158         if (LUSTRE_CFG_BUFLEN(lcfg, 1) == 0 || LUSTRE_CFG_BUFLEN(lcfg, 2) == 0)
159                 RETURN(rc = -EINVAL);
160
161         obd->obd_fsops = fsfilt_get_ops(lustre_cfg_string(lcfg, 2));
162         if (IS_ERR(obd->obd_fsops))
163                 RETURN(rc = PTR_ERR(obd->obd_fsops));
164
165         page = __get_free_page(GFP_KERNEL);
166         if (!page)
167                 RETURN(-ENOMEM);
168
169         options = (char *)page;
170         memset(options, 0, PAGE_SIZE);
171
172         if (LUSTRE_CFG_BUFLEN(lcfg, 4) > 0 && lustre_cfg_buf(lcfg, 4))
173                 sprintf(options , ",%s", lustre_cfg_string(lcfg, 4));
174
175         //FIXME mount was already done in lustre_fill_super,
176         //we just need to access it
177         mnt = do_kern_mount(lustre_cfg_string(lcfg, 2), 0,
178                             lustre_cfg_string(lcfg, 1), (void *)options);
179         free_page(page);
180         if (IS_ERR(mnt)) {
181                 rc = PTR_ERR(mnt);
182                 CERROR("do_kern_mount failed: rc = %d\n", rc);
183                 GOTO(err_ops, rc);
184         }
185
186         CDEBUG(D_SUPER, "%s: mnt = %p\n", lustre_cfg_string(lcfg, 1), mnt);
187
188         LASSERT(!lvfs_check_rdonly(lvfs_sbdev(mnt->mnt_sb)));
189
190         rc = mgs_fs_setup(obd, mnt);
191         if (rc) {
192                 CERROR("%s: MGS filesystem method init failed: rc = %d\n",
193                        obd->obd_name, rc);
194                 GOTO(err_ns, rc);
195         }
196
197         rc = llog_start_commit_thread();
198         if (rc < 0)
199                 GOTO(err_fs, rc);
200 #if 0  
201         //FIXME: no LDLM support for llog now
202         ptlrpc_init_client(LDLM_CB_REQUEST_PORTAL, LDLM_CB_REPLY_PORTAL,
203                            "mgs_ldlm_client", &obd->obd_ldlm_client);
204 #endif
205         obd->obd_replayable = 1;
206
207         rc = mgs_postsetup(obd);
208         if (rc)
209                 GOTO(err_fs, rc);
210
211         lprocfs_init_vars(mgs, &lvars);
212         lprocfs_obd_setup(obd, lvars.obd_vars);
213
214         if (obd->obd_recovering) {
215                 LCONSOLE_WARN("MGT %s now serving %s, but will be in recovery "
216                               "until %d %s reconnect, or if no clients "
217                               "reconnect for %d:%.02d; during that time new "
218                               "clients will not be allowed to connect. "
219                               "Recovery progress can be monitored by watching "
220                               "/proc/fs/lustre/mgs/%s/recovery_status.\n",
221                               obd->obd_name,
222                               lustre_cfg_string(lcfg, 1),
223                               obd->obd_recoverable_clients,
224                               (obd->obd_recoverable_clients == 1) 
225                               ? "client" : "clients",
226                               (int)(OBD_RECOVERY_TIMEOUT / HZ) / 60,
227                               (int)(OBD_RECOVERY_TIMEOUT / HZ) % 60,
228                               obd->obd_name);
229         } else {
230                 LCONSOLE_INFO("MGT %s now serving %s with recovery %s.\n",
231                               obd->obd_name,
232                               lustre_cfg_string(lcfg, 1),
233                               obd->obd_replayable ? "enabled" : "disabled");
234         }
235 //FIXME: no ldlm support now
236         ldlm_timeout = 6;
237         ping_evictor_start();
238
239         RETURN(0);
240
241 err_fs:
242         /* No extra cleanup needed for llog_init_commit_thread() */
243         mgs_fs_cleanup(obd);
244 err_put:
245         unlock_kernel();
246         mntput(mgs->mgs_vfsmnt);
247         mgs->mgs_sb = 0;
248         lock_kernel();
249 err_ops:
250         fsfilt_put_ops(obd->obd_fsops);
251         return rc;
252 }
253
254
255 static int mgs_postsetup(struct obd_device *obd)
256 {
257         struct mgs_obd *mgs = &obd->u.mgs;
258         int rc = 0;
259         ENTRY;
260
261         rc = llog_setup(obd, LLOG_CONFIG_ORIG_CTXT, obd, 0, NULL,
262                         &llog_lvfs_ops);
263         RETURN(rc);
264 }
265
266 static int mgs_precleanup(struct obd_device *obd, int stage)
267 {
268         int rc = 0;
269         ENTRY;
270
271         llog_cleanup(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT));
272         rc = obd_llog_finish(obd, 0);
273         RETURN(rc);
274 }
275
276 static int mgs_cleanup(struct obd_device *obd)
277 {
278         struct mgs_obd *mgs = &obd->u.mgs;
279         lvfs_sbdev_type save_dev;
280         int must_relock = 0;
281         ENTRY;
282
283         ping_evictor_stop();
284
285         if (mgs->mgs_sb == NULL)
286                 RETURN(0);
287         save_dev = lvfs_sbdev(mgs->mgs_sb);
288
289         lprocfs_obd_cleanup(obd);
290
291         mgs_update_server_data(obd, 1);
292
293         mgs_fs_cleanup(obd);
294
295         if (atomic_read(&obd->u.mgs.mgs_vfsmnt->mnt_count) > 2)
296                 CERROR("%s: mount busy, mnt_count %d != 2\n", obd->obd_name,
297                        atomic_read(&obd->u.mgs.mgs_vfsmnt->mnt_count));
298
299         /* We can only unlock kernel if we are in the context of sys_ioctl,
300            otherwise we never called lock_kernel */
301         if (kernel_locked()) {
302                 unlock_kernel();
303                 must_relock++;
304         }
305
306         mntput(mgs->mgs_vfsmnt);
307         mgs->mgs_sb = NULL;
308
309         spin_lock_bh(&obd->obd_processing_task_lock);
310         if (obd->obd_recovering) {
311                 target_cancel_recovery_timer(obd);
312                 obd->obd_recovering = 0;
313         }
314         spin_unlock_bh(&obd->obd_processing_task_lock);
315
316         lvfs_clear_rdonly(save_dev);
317
318         if (must_relock)
319                 lock_kernel();
320
321         fsfilt_put_ops(obd->obd_fsops);
322
323         LCONSOLE_INFO("MDT %s has stopped.\n", obd->obd_name);
324
325         RETURN(0);
326 }
327
328 /* Look up an entry by inode number. */
329 /* this function ONLY returns valid dget'd dentries with an initialized inode
330    or errors */
331 struct dentry *mgs_fid2dentry(struct mgs_obd *mgs, struct ll_fid *fid,
332                               struct vfsmount **mnt)
333 {
334         char fid_name[32];
335         unsigned long ino = fid->id;
336         __u32 generation = fid->generation;
337         struct inode *inode;
338         struct dentry *result;
339
340         if (ino == 0)
341                 RETURN(ERR_PTR(-ESTALE));
342
343         snprintf(fid_name, sizeof(fid_name), "0x%lx", ino);
344
345         CDEBUG(D_DENTRY, "--> mgs_fid2dentry: ino/gen %lu/%u, sb %p\n",
346                ino, generation, mgs->mgs_sb);
347
348         /* under ext3 this is neither supposed to return bad inodes
349            nor NULL inodes. */
350         result = ll_lookup_one_len(fid_name, mgs->mgs_fid_de, strlen(fid_name));
351         if (IS_ERR(result))
352                 RETURN(result);
353
354         inode = result->d_inode;
355         if (!inode)
356                 RETURN(ERR_PTR(-ENOENT));
357
358         if (generation && inode->i_generation != generation) {
359                 /* we didn't find the right inode.. */
360                 CERROR("bad inode %lu, link: %lu ct: %d or generation %u/%u\n",
361                        inode->i_ino, (unsigned long)inode->i_nlink,
362                        atomic_read(&inode->i_count), inode->i_generation,
363                        generation);
364                 dput(result);
365                 RETURN(ERR_PTR(-ENOENT));
366         }
367
368         if (mnt) {
369                 *mnt = mgs->mgs_vfsmnt;
370                 mntget(*mnt);
371         }
372
373         RETURN(result);
374 }
375
376 static struct dentry *mgs_lvfs_fid2dentry(__u64 id, __u32 gen, __u64 gr,
377                                           void *data)
378 {
379         struct obd_device *obd = data;
380         struct ll_fid fid;
381         fid.id = id;
382         fid.generation = gen;
383         return mgs_fid2dentry(&obd->u.mgs, &fid, NULL);
384 }
385
386 struct lvfs_callback_ops mgs_lvfs_ops = {
387         l_fid2dentry:     mgs_lvfs_fid2dentry,
388 };
389
390
391 int mgs_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
392                   void *karg, void *uarg)
393 {
394         static struct obd_uuid cfg_uuid = { .uuid = "config_uuid" };
395         struct obd_device *obd = exp->exp_obd;
396         struct mgs_obd *mgs = &obd->u.mgs;
397         struct obd_ioctl_data *data = karg;
398         struct lvfs_run_ctxt saved;
399         int rc = 0;
400
401         ENTRY;
402         CDEBUG(D_IOCTL, "handling ioctl cmd %#x\n", cmd);
403
404         switch (cmd) {
405         case OBD_IOC_RECORD: {
406                 char *name = data->ioc_inlbuf1;
407                 if (mgs->mgs_cfg_llh)
408                         RETURN(-EBUSY);
409
410                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
411                 rc = llog_create(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
412                                  &mds->mds_cfg_llh, NULL, name);
413                 if (rc == 0)
414                         llog_init_handle(mds->mds_cfg_llh, LLOG_F_IS_PLAIN,
415                                          &cfg_uuid);
416                 else
417                         mds->mds_cfg_llh = NULL;
418                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
419
420                 RETURN(rc);
421         }
422
423         case OBD_IOC_ENDRECORD: {
424                 if (!mds->mds_cfg_llh)
425                         RETURN(-EBADF);
426
427                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
428                 rc = llog_close(mds->mds_cfg_llh);
429                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
430
431                 mds->mds_cfg_llh = NULL;
432                 RETURN(rc);
433         }
434
435         case OBD_IOC_CLEAR_LOG: {
436                 char *name = data->ioc_inlbuf1;
437                 if (mds->mds_cfg_llh)
438                         RETURN(-EBUSY);
439
440                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
441                 rc = llog_create(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
442                                  &mds->mds_cfg_llh, NULL, name);
443                 if (rc == 0) {
444                         llog_init_handle(mds->mds_cfg_llh, LLOG_F_IS_PLAIN,
445                                          NULL);
446
447                         rc = llog_destroy(mds->mds_cfg_llh);
448                         llog_free_handle(mds->mds_cfg_llh);
449                 }
450                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
451
452                 mds->mds_cfg_llh = NULL;
453                 RETURN(rc);
454         }
455
456         case OBD_IOC_DORECORD: {
457                 char *cfg_buf;
458                 struct llog_rec_hdr rec;
459                 if (!mds->mds_cfg_llh)
460                         RETURN(-EBADF);
461
462                 rec.lrh_len = llog_data_len(data->ioc_plen1);
463
464                 if (data->ioc_type == LUSTRE_CFG_TYPE) {
465                         rec.lrh_type = OBD_CFG_REC;
466                 } else {
467                         CERROR("unknown cfg record type:%d \n", data->ioc_type);
468                         RETURN(-EINVAL);
469                 }
470
471                 OBD_ALLOC(cfg_buf, data->ioc_plen1);
472                 if (cfg_buf == NULL)
473                         RETURN(-EINVAL);
474                 rc = copy_from_user(cfg_buf, data->ioc_pbuf1, data->ioc_plen1);
475                 if (rc) {
476                         OBD_FREE(cfg_buf, data->ioc_plen1);
477                         RETURN(rc);
478                 }
479
480                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
481                 rc = llog_write_rec(mds->mds_cfg_llh, &rec, NULL, 0,
482                                     cfg_buf, -1);
483                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
484
485                 OBD_FREE(cfg_buf, data->ioc_plen1);
486                 RETURN(rc);
487         }
488
489         case OBD_IOC_PARSE: {
490                 struct llog_ctxt *ctxt =
491                         llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
492                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
493                 rc = class_config_parse_llog(ctxt, data->ioc_inlbuf1, NULL);
494                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
495                 if (rc)
496                         RETURN(rc);
497
498                 RETURN(rc);
499         }
500
501         case OBD_IOC_DUMP_LOG: {
502                 struct llog_ctxt *ctxt =
503                         llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
504                 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
505                 rc = class_config_dump_llog(ctxt, data->ioc_inlbuf1, NULL);
506                 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
507                 if (rc)
508                         RETURN(rc);
509
510                 RETURN(rc);
511         }
512
513         case OBD_IOC_SYNC: {
514                 CDEBUG(D_HA, "syncing mds %s\n", obd->obd_name);
515                 rc = fsfilt_sync(obd, obd->u.mds.mds_sb);
516                 RETURN(rc);
517         }
518
519         case OBD_IOC_SET_READONLY: {
520                 void *handle;
521                 struct inode *inode = obd->u.mds.mds_sb->s_root->d_inode;
522                 BDEVNAME_DECLARE_STORAGE(tmp);
523                 CERROR("*** setting device %s read-only ***\n",
524                        ll_bdevname(obd->u.mds.mds_sb, tmp));
525
526                 handle = fsfilt_start(obd, inode, FSFILT_OP_MKNOD, NULL);
527                 if (!IS_ERR(handle))
528                         rc = fsfilt_commit(obd, inode, handle, 1);
529
530                 CDEBUG(D_HA, "syncing mds %s\n", obd->obd_name);
531                 rc = fsfilt_sync(obd, obd->u.mds.mds_sb);
532
533                 lvfs_set_rdonly(lvfs_sbdev(obd->u.mds.mds_sb));
534                 RETURN(0);
535         }
536
537         case OBD_IOC_CATLOGLIST: {
538                 int count = mds->mds_lov_desc.ld_tgt_count;
539                 rc = llog_catalog_list(obd, count, data);
540                 RETURN(rc);
541
542         }
543         case OBD_IOC_LLOG_CHECK:
544         case OBD_IOC_LLOG_CANCEL:
545         case OBD_IOC_LLOG_REMOVE: {
546                 struct llog_ctxt *ctxt =
547                         llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
548                 int rc2;
549
550                 obd_llog_finish(obd, mds->mds_lov_desc.ld_tgt_count);
551                 push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
552                 rc = llog_ioctl(ctxt, cmd, data);
553                 pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
554                 llog_cat_initialize(obd, mds->mds_lov_desc.ld_tgt_count);
555                 rc2 = obd_set_info(mds->mds_osc_exp, strlen("mds_conn"),
556                                    "mds_conn", 0, NULL);
557                 if (!rc)
558                         rc = rc2;
559                 RETURN(rc);
560         }
561         case OBD_IOC_LLOG_INFO:
562         case OBD_IOC_LLOG_PRINT: {
563                 struct llog_ctxt *ctxt =
564                         llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);
565
566                 push_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
567                 rc = llog_ioctl(ctxt, cmd, data);
568                 pop_ctxt(&saved, &ctxt->loc_exp->exp_obd->obd_lvfs_ctxt, NULL);
569
570                 RETURN(rc);
571         }
572
573         case OBD_IOC_ABORT_RECOVERY:
574                 CERROR("aborting recovery for device %s\n", obd->obd_name);
575                 target_abort_recovery(obd);
576                 RETURN(0);
577
578         default:
579                 CDEBUG(D_INFO, "unknown command %x\n", cmd);
580                 RETURN(-EINVAL);
581         }
582         RETURN(0);
583
584 }
585 /* use obd ops to offer management infrastructure */
586 static struct obd_ops mgs_obd_ops = {
587         .o_owner           = THIS_MODULE,
588         .o_connect         = mgs_connect,
589         .o_init_export     = mgs_init_export,
590         .o_destroy_export  = mgs_destroy_export,
591         .o_disconnect      = mgs_disconnect,
592         .o_setup           = mgs_setup,
593         .o_precleanup      = mgs_precleanup,
594         .o_cleanup         = mgs_cleanup,
595         .o_iocontrol       = mgs_iocontrol,
596         .o_create          = mgs_obd_create,
597         .o_destroy         = mgs_obd_destroy,
598         .o_llog_init       = mgs_llog_init,
599         .o_llog_finish     = mgs_llog_finish,
600         .o_notify          = mgs_notify,
601 };
602
603 static struct obd_ops mdt_obd_ops = {
604         .o_owner           = THIS_MODULE,
605         .o_setup           = mgt_setup,
606         .o_cleanup         = mgt_cleanup,
607 };
608
609 static int __init mgs_init(void)
610 {
611         int rc;
612         struct lprocfs_static_vars lvars;
613
614         lprocfs_init_vars(mgs, &lvars);
615         class_register_type(&mgs_obd_ops, lvars.module_vars, LUSTRE_MGS_NAME);
616         lprocfs_init_vars(mgt, &lvars);
617         class_register_type(&mgt_obd_ops, lvars.module_vars, LUSTRE_MGT_NAME);
618
619         return 0;
620 }
621
622 static void /*__exit*/ mgs_exit(void)
623 {
624         class_unregister_type(LUSTRE_MGS_NAME);
625         class_unregister_type(LUSTRE_MGT_NAME);
626 }
627
628 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
629 MODULE_DESCRIPTION("Lustre  Management Server (MGS)");
630 MODULE_LICENSE("GPL");
631
632 module_init(mgs_init);
633 module_exit(mgs_exit);