Whamcloud - gitweb
35a7f4a9e5cc4ba122ff183e7b50b42110b53959
[fs/lustre-release.git] / lustre / quota / quota_interface.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  lustre/quota/quota_interface.c
5  *
6  *  Copyright (c) 2001-2005 Cluster File Systems, Inc.
7  *
8  *   This file is part of Lustre, http://www.lustre.org.
9  *
10  *   No redistribution or use is permitted outside of Cluster File Systems, Inc.
11  *
12  */
13 #ifndef EXPORT_SYMTAB
14 # define EXPORT_SYMTAB
15 #endif
16 #define DEBUG_SUBSYSTEM S_MDS
17
18 #ifdef __KERNEL__
19 # include <linux/version.h>
20 # include <linux/module.h>
21 # include <linux/init.h>
22 # include <linux/fs.h>
23 # include <linux/jbd.h>
24 # include <linux/ext3_fs.h>
25 # include <linux/parser.h>
26 # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
27 #  include <linux/smp_lock.h>
28 #  include <linux/buffer_head.h>
29 #  include <linux/workqueue.h>
30 #  include <linux/mount.h>
31 # else
32 #  include <linux/locks.h>
33 # endif
34 #else /* __KERNEL__ */
35 # include <liblustre.h>
36 #endif
37
38 #include <obd_class.h>
39 #include <lustre_mds.h>
40 #include <lustre_dlm.h>
41 #include <lustre_cfg.h>
42 #include <obd_ost.h>
43 #include <lustre_fsfilt.h>
44 #include <lustre_quota.h>
45 #include "quota_internal.h"
46
47
48 #ifdef __KERNEL__
49 extern unsigned long default_bunit_sz;
50 extern unsigned long default_btune_ratio;
51 extern unsigned long default_iunit_sz;
52 extern unsigned long default_itune_ratio;
53
54 enum {
55         Opt_quotaon, Opt_iunit_sz, Opt_bunit_sz,
56         Opt_itune_ratio, Opt_btune_ratio, Opt_err,
57 };
58
59 static match_table_t tokens = {
60         {Opt_quotaon, "quotaon=%10s"},
61         {Opt_iunit_sz, "iunit=%u"},
62         {Opt_bunit_sz, "bunit=%u"},
63         {Opt_itune_ratio, "itune=%u"},
64         {Opt_btune_ratio, "btune=%u"},
65         {Opt_err, NULL}
66 };
67
68 static int
69 quota_parse_config_args(char *options, int *quotaon, int *type,
70                         struct lustre_quota_ctxt *qctxt)
71 {
72         char *opt;
73         substring_t args[MAX_OPT_ARGS];
74         int option;
75         int rc = 0;
76         unsigned long iunit = 0, bunit = 0, itune = 0, btune = 0;
77         ENTRY;
78
79         while ((opt = strsep (&options, ",")) != NULL) {
80                 int token;
81                 if (!*opt)
82                         continue;
83
84                 token = match_token(opt, tokens, args);
85                 switch(token) {
86                 case Opt_quotaon: {
87                         char *quota_type = match_strdup(&args[0]);
88                         if (!quota_type)
89                                 GOTO(out, rc = -EINVAL);
90
91                         *quotaon = 1;
92                         if (strchr(quota_type, 'u') && strchr(quota_type, 'g'))
93                                 *type = UGQUOTA;
94                         else if (strchr(quota_type, 'u'))
95                                 *type = USRQUOTA;
96                         else if (strchr(quota_type, 'g'))
97                                 *type = GRPQUOTA;
98                         else {
99                                 *quotaon = 0;
100                                 rc = -EINVAL;
101                         }
102                         break;
103                 }
104                 case Opt_iunit_sz:
105                         if (match_int(&args[0], &option))
106                                 rc = -EINVAL;
107                         iunit = option;
108                         break;
109                 case Opt_bunit_sz:
110                         if (match_int(&args[0], &option))
111                                 rc = -EINVAL;
112                         bunit = option;
113                         break;
114                 case Opt_itune_ratio:
115                         if (match_int(&args[0], &option) ||
116                             option <= 0 || option >= 100)
117                                 rc = -EINVAL;
118                         itune = option;
119                         break;
120                 case Opt_btune_ratio:
121                         if (match_int(&args[0], &option) ||
122                             option <= 0 || option >= 100)
123                                 rc = -EINVAL;
124                         btune = option;
125                         break;
126                 default:
127                         rc = -EINVAL;
128                 }
129
130                 if (rc)
131                         GOTO(out, rc);
132         }
133
134         /* adjust the tunables of qunits based on quota config args */
135         if (iunit)
136                 qctxt->lqc_iunit_sz = iunit;
137         if (itune)
138                 qctxt->lqc_itune_sz = qctxt->lqc_iunit_sz *
139                                       itune / 100;
140         else
141                 qctxt->lqc_itune_sz = qctxt->lqc_iunit_sz *
142                                       default_itune_ratio / 100;
143         if (bunit)
144                 qctxt->lqc_bunit_sz = bunit << 20;
145         if (btune)
146                 qctxt->lqc_btune_sz = ((qctxt->lqc_bunit_sz >> 20) *
147                                         btune / 100) << 20;
148         else
149                 qctxt->lqc_btune_sz = ((qctxt->lqc_bunit_sz >> 20) *
150                                         default_btune_ratio / 100) << 20;
151
152         CDEBUG(D_INFO, "iunit=%lu bunit=%lu itune=%lu btune=%lu\n",
153                qctxt->lqc_iunit_sz, qctxt->lqc_bunit_sz,
154                qctxt->lqc_itune_sz, qctxt->lqc_btune_sz);
155         EXIT;
156
157  out:
158         if (rc)
159                 CERROR("quota config args parse error!(rc = %d) usage: "
160                 "--quota quotaon=u|g|ug,iunit=100,bunit=100,itune=50,btune=50\n",
161                  rc);
162
163         return rc;
164 }
165
166 static int auto_quota_on(struct obd_device *obd, int type,
167                          struct super_block *sb, int is_master)
168 {
169         struct obd_quotactl *oqctl;
170         struct lvfs_run_ctxt saved;
171         int rc;
172         ENTRY;
173
174         LASSERT(type == USRQUOTA || type == GRPQUOTA || type == UGQUOTA);
175
176         OBD_ALLOC_PTR(oqctl);
177         if (!oqctl)
178                 RETURN(-ENOMEM);
179
180         oqctl->qc_type = type;
181         oqctl->qc_cmd = Q_QUOTAON;
182         oqctl->qc_id = QFMT_LDISKFS;
183
184         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
185
186         if (!is_master)
187                 goto local_quota;
188
189         /* turn on cluster wide quota */
190         rc = mds_admin_quota_on(obd, oqctl);
191         if (rc) {
192                 CERROR("auto enable admin quota error! err = %d\n", rc);
193                 GOTO(out_pop, rc);
194         }
195 local_quota:
196         /* turn on local quota */
197         rc = fsfilt_quotactl(obd, sb, oqctl);
198         CDEBUG_EX(rc ? D_ERROR : D_INFO, "auto-enable quota. rc=%d\n", rc);
199         if (rc && is_master)
200                 mds_quota_off(obd, oqctl);
201 out_pop:
202         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
203
204         OBD_FREE_PTR(oqctl);
205         RETURN(rc);
206 }
207
208 static int mds_auto_quota_on(struct obd_device *obd, int type)
209 {
210         int rc;
211         ENTRY;
212         rc = auto_quota_on(obd, type, obd->u.obt.obt_sb, 1);
213         RETURN(rc);
214 }
215
216 static int filter_auto_quota_on(struct obd_device *obd, int type)
217 {
218         int rc = 0;
219         ENTRY;
220         rc = auto_quota_on(obd, type, obd->u.obt.obt_sb, 0);
221         RETURN(rc);
222 }
223
224 static int filter_quota_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
225 {
226         int rc = 0;
227         struct obd_device_target *obt = &obd->u.obt;
228         ENTRY;
229
230         atomic_set(&obt->obt_quotachecking, 1);
231         rc = qctxt_init(&obt->obt_qctxt, obt->obt_sb, NULL);
232         if (rc) {
233                 CERROR("initialize quota context failed! (rc:%d)\n", rc);
234                 RETURN(rc);
235         }
236
237         /* Based on quota config args, set qunit sizes and enable quota */
238         if (LUSTRE_CFG_BUFLEN(lcfg, 5) > 0 && lustre_cfg_buf(lcfg, 5)) {
239                 char *args = lustre_cfg_string(lcfg, 5);
240                 int quotaon = 0, type;
241                 int err = 0;
242
243                 err = quota_parse_config_args(args, &quotaon, &type,
244                                               &obd->u.obt.obt_qctxt);
245                 if (!err && quotaon)
246                         filter_auto_quota_on(obd, type);
247         }
248
249         RETURN(rc);
250 }
251
252 static int filter_quota_cleanup(struct obd_device *obd)
253 {
254         qctxt_cleanup(&obd->u.obt.obt_qctxt, 0);
255         return 0;
256 }
257
258 static int filter_quota_setinfo(struct obd_export *exp, struct obd_device *obd)
259 {
260         /* setup the quota context import */
261         obd->u.obt.obt_qctxt.lqc_import = exp->exp_imp_reverse;
262         /* start quota slave recovery thread. (release high limits) */
263         qslave_start_recovery(obd, &obd->u.obt.obt_qctxt);
264         return 0;
265 }
266 static int filter_quota_enforce(struct obd_device *obd, unsigned int ignore)
267 {
268         ENTRY;
269
270         if (!sb_any_quota_enabled(obd->u.obt.obt_sb))
271                 RETURN(0);
272
273         if (ignore)
274                 cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
275         else
276                 cap_lower(current->cap_effective, CAP_SYS_RESOURCE);
277
278         RETURN(0);
279 }
280
281 static int filter_quota_getflag(struct obd_device *obd, struct obdo *oa)
282 {
283         struct obd_device_target *obt = &obd->u.obt;
284         int err, cnt, rc = 0;
285         struct obd_quotactl *oqctl;
286         ENTRY;
287
288         if (!sb_any_quota_enabled(obt->obt_sb))
289                 RETURN(0);
290
291         oa->o_flags &= ~(OBD_FL_NO_USRQUOTA | OBD_FL_NO_GRPQUOTA);
292
293         OBD_ALLOC_PTR(oqctl);
294         if (!oqctl) {
295                 CERROR("Not enough memory!");
296                 RETURN(-ENOMEM);
297         }
298
299         for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
300                 memset(oqctl, 0, sizeof(*oqctl));
301
302                 oqctl->qc_cmd = Q_GETQUOTA;
303                 oqctl->qc_type = cnt;
304                 oqctl->qc_id = (cnt == USRQUOTA) ? oa->o_uid : oa->o_gid;
305                 err = fsfilt_quotactl(obd, obt->obt_sb, oqctl);
306                 if (err) {
307                         if (!rc)
308                                 rc = err;
309                         continue;
310                 }
311
312                 /* set over quota flags for a uid/gid */
313                 oa->o_valid |= (cnt == USRQUOTA) ?
314                                OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA;
315                 if (oqctl->qc_dqblk.dqb_bhardlimit &&
316                    (toqb(oqctl->qc_dqblk.dqb_curspace) >
317                     oqctl->qc_dqblk.dqb_bhardlimit))
318                         oa->o_flags |= (cnt == USRQUOTA) ?
319                                 OBD_FL_NO_USRQUOTA : OBD_FL_NO_GRPQUOTA;
320         }
321         OBD_FREE_PTR(oqctl);
322         RETURN(rc);
323 }
324
325 static int filter_quota_acquire(struct obd_device *obd, unsigned int uid,
326                                 unsigned int gid)
327 {
328         struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt;
329         int rc;
330         ENTRY;
331
332         rc = qctxt_adjust_qunit(obd, qctxt, uid, gid, 1, 1);
333         RETURN(rc == -EAGAIN);
334 }
335
336 static int mds_quota_init(void)
337 {
338         return lustre_dquot_init();
339 }
340
341 static int mds_quota_exit(void)
342 {
343         lustre_dquot_exit();
344         return 0;
345 }
346
347 static int mds_quota_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
348 {
349         struct obd_device_target *obt = &obd->u.obt;
350         struct mds_obd *mds = &obd->u.mds;
351         int rc;
352         ENTRY;
353
354         atomic_set(&obt->obt_quotachecking, 1);
355         /* initialize quota master and quota context */
356         sema_init(&mds->mds_qonoff_sem, 1);
357         rc = qctxt_init(&obt->obt_qctxt, obt->obt_sb, dqacq_handler);
358         if (rc) {
359                 CERROR("initialize quota context failed! (rc:%d)\n", rc);
360                 RETURN(rc);
361         }
362
363         /* Based on quota config args, set qunit sizes and enable quota */
364         if (LUSTRE_CFG_BUFLEN(lcfg, 5) > 0 && lustre_cfg_buf(lcfg, 5)) {
365                 char *args = lustre_cfg_string(lcfg, 5);
366                 int quotaon = 0, type;
367                 int err;
368
369                 err = quota_parse_config_args(args, &quotaon, &type,
370                                               &obt->obt_qctxt);
371                 if (!err && quotaon)
372                         mds_auto_quota_on(obd, type);
373         }
374         RETURN(rc);
375 }
376
377 static int mds_quota_cleanup(struct obd_device *obd)
378 {
379         qctxt_cleanup(&obd->u.obt.obt_qctxt, 0);
380         RETURN(0);
381 }
382
383 static int mds_quota_fs_cleanup(struct obd_device *obd)
384 {
385         struct mds_obd *mds = &obd->u.mds;
386         int i;
387         ENTRY;
388
389         /* close admin quota files */
390         down(&mds->mds_qonoff_sem);
391         for (i = 0; i < MAXQUOTAS; i++) {
392                 if (mds->mds_quota_info.qi_files[i]) {
393                         filp_close(mds->mds_quota_info.qi_files[i], 0);
394                         mds->mds_quota_info.qi_files[i] = NULL;
395                 }
396         }
397         up(&mds->mds_qonoff_sem);
398         RETURN(0);
399 }
400 #endif /* __KERNEL__ */
401
402 struct osc_quota_info {
403         struct list_head        oqi_hash;       /* hash list */
404         struct client_obd      *oqi_cli;        /* osc obd */
405         unsigned int            oqi_id;         /* uid/gid of a file */
406         short                   oqi_type;       /* quota type */
407 };
408
409 spinlock_t qinfo_list_lock = SPIN_LOCK_UNLOCKED;
410
411 static struct list_head qinfo_hash[NR_DQHASH];
412 /* SLAB cache for client quota context */
413 cfs_mem_cache_t *qinfo_cachep = NULL;
414
415 static inline int const hashfn(struct client_obd *cli,
416                                unsigned long id,
417                                int type)
418 {
419         unsigned long tmp = ((unsigned long)cli>>6) ^ id;
420         tmp = (tmp * (MAXQUOTAS - type)) % NR_DQHASH;
421         return tmp;
422 }
423
424 /* caller must hold qinfo_list_lock */
425 static inline void insert_qinfo_hash(struct osc_quota_info *oqi)
426 {
427         struct list_head *head = qinfo_hash +
428                 hashfn(oqi->oqi_cli, oqi->oqi_id, oqi->oqi_type);
429
430         LASSERT_SPIN_LOCKED(&qinfo_list_lock);
431         list_add(&oqi->oqi_hash, head);
432 }
433
434 /* caller must hold qinfo_list_lock */
435 static inline void remove_qinfo_hash(struct osc_quota_info *oqi)
436 {
437         LASSERT_SPIN_LOCKED(&qinfo_list_lock);
438         list_del_init(&oqi->oqi_hash);
439 }
440
441 /* caller must hold qinfo_list_lock */
442 static inline struct osc_quota_info *find_qinfo(struct client_obd *cli,
443                                                 unsigned int id, int type)
444 {
445         unsigned int hashent = hashfn(cli, id, type);
446         struct osc_quota_info *oqi;
447
448         LASSERT_SPIN_LOCKED(&qinfo_list_lock);
449         list_for_each_entry(oqi, &qinfo_hash[hashent], oqi_hash) {
450                 if (oqi->oqi_cli == cli &&
451                     oqi->oqi_id == id && oqi->oqi_type == type)
452                         return oqi;
453         }
454         return NULL;
455 }
456
457 static struct osc_quota_info *alloc_qinfo(struct client_obd *cli,
458                                           unsigned int id, int type)
459 {
460         struct osc_quota_info *oqi;
461         ENTRY;
462
463         OBD_SLAB_ALLOC(oqi, qinfo_cachep, CFS_ALLOC_STD, sizeof(*oqi));
464         if(!oqi)
465                 RETURN(NULL);
466
467         INIT_LIST_HEAD(&oqi->oqi_hash);
468         oqi->oqi_cli = cli;
469         oqi->oqi_id = id;
470         oqi->oqi_type = type;
471
472         RETURN(oqi);
473 }
474
475 static void free_qinfo(struct osc_quota_info *oqi)
476 {
477         OBD_SLAB_FREE(oqi, qinfo_cachep, sizeof(*oqi));
478 }
479
480 int osc_quota_chkdq(struct client_obd *cli,
481                     unsigned int uid, unsigned int gid)
482 {
483         unsigned int id;
484         int cnt, rc = QUOTA_OK;
485         ENTRY;
486
487         spin_lock(&qinfo_list_lock);
488         for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
489                 struct osc_quota_info *oqi = NULL;
490
491                 id = (cnt == USRQUOTA) ? uid : gid;
492                 oqi = find_qinfo(cli, id, cnt);
493                 if (oqi) {
494                         rc = NO_QUOTA;
495                         break;
496                 }
497         }
498         spin_unlock(&qinfo_list_lock);
499
500         RETURN(rc);
501 }
502
503 int osc_quota_setdq(struct client_obd *cli,
504                     unsigned int uid, unsigned int gid,
505                     obd_flag valid, obd_flag flags)
506 {
507         unsigned int id;
508         obd_flag noquota;
509         int cnt, rc = 0;
510         ENTRY;
511
512
513         for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
514                 struct osc_quota_info *oqi, *old;
515
516                 if (!(valid & ((cnt == USRQUOTA) ?
517                     OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA)))
518                         continue;
519
520                 id = (cnt == USRQUOTA) ? uid : gid;
521                 noquota = (cnt == USRQUOTA) ?
522                     (flags & OBD_FL_NO_USRQUOTA) : (flags & OBD_FL_NO_GRPQUOTA);
523
524                 oqi = alloc_qinfo(cli, id, cnt);
525                 if (oqi) {
526                         spin_lock(&qinfo_list_lock);
527
528                         old = find_qinfo(cli, id, cnt);
529                         if (old && !noquota)
530                                 remove_qinfo_hash(old);
531                         else if (!old && noquota)
532                                 insert_qinfo_hash(oqi);
533
534                         spin_unlock(&qinfo_list_lock);
535
536                         if (old || !noquota)
537                                 free_qinfo(oqi);
538                         if (old && !noquota)
539                                 free_qinfo(old);
540                 } else {
541                         CERROR("not enough mem!\n");
542                         rc = -ENOMEM;
543                         break;
544                 }
545         }
546
547         RETURN(rc);
548 }
549
550 int osc_quota_cleanup(struct obd_device *obd)
551 {
552         struct client_obd *cli = &obd->u.cli;
553         struct osc_quota_info *oqi, *n;
554         int i;
555         ENTRY;
556
557         spin_lock(&qinfo_list_lock);
558         for (i = 0; i < NR_DQHASH; i++) {
559                 list_for_each_entry_safe(oqi, n, &qinfo_hash[i], oqi_hash) {
560                         if (oqi->oqi_cli != cli)
561                                 continue;
562                         remove_qinfo_hash(oqi);
563                         free_qinfo(oqi);
564                 }
565         }
566         spin_unlock(&qinfo_list_lock);
567
568         RETURN(0);
569 }
570
571 int osc_quota_init(void)
572 {
573         int i;
574         ENTRY;
575
576         LASSERT(qinfo_cachep == NULL);
577         qinfo_cachep = cfs_mem_cache_create("osc_quota_info",
578                                          sizeof(struct osc_quota_info),
579                                          0, 0);
580         if (!qinfo_cachep)
581                 RETURN(-ENOMEM);
582
583         for (i = 0; i < NR_DQHASH; i++)
584                 INIT_LIST_HEAD(qinfo_hash + i);
585
586         RETURN(0);
587 }
588
589 int osc_quota_exit(void)
590 {
591         struct osc_quota_info *oqi, *n;
592         int i, rc;
593         ENTRY;
594
595         spin_lock(&qinfo_list_lock);
596         for (i = 0; i < NR_DQHASH; i++) {
597                 list_for_each_entry_safe(oqi, n, &qinfo_hash[i], oqi_hash) {
598                         remove_qinfo_hash(oqi);
599                         free_qinfo(oqi);
600                 }
601         }
602         spin_unlock(&qinfo_list_lock);
603
604         rc = cfs_mem_cache_destroy(qinfo_cachep);
605         LASSERTF(rc == 0, "couldn't destory qinfo_cachep slab\n");
606         qinfo_cachep = NULL;
607
608         RETURN(0);
609 }
610
611 #ifdef __KERNEL__
612 quota_interface_t mds_quota_interface = {
613         .quota_init     = mds_quota_init,
614         .quota_exit     = mds_quota_exit,
615         .quota_setup    = mds_quota_setup,
616         .quota_cleanup  = mds_quota_cleanup,
617         .quota_check    = target_quota_check,
618         .quota_ctl      = mds_quota_ctl,
619         .quota_fs_cleanup       =mds_quota_fs_cleanup,
620         .quota_recovery = mds_quota_recovery,
621         .quota_adjust   = mds_quota_adjust,
622 };
623
624 quota_interface_t filter_quota_interface = {
625         .quota_setup    = filter_quota_setup,
626         .quota_cleanup  = filter_quota_cleanup,
627         .quota_check    = target_quota_check,
628         .quota_ctl      = filter_quota_ctl,
629         .quota_setinfo  = filter_quota_setinfo,
630         .quota_enforce  = filter_quota_enforce,
631         .quota_getflag  = filter_quota_getflag,
632         .quota_acquire  = filter_quota_acquire,
633         .quota_adjust   = filter_quota_adjust,
634 };
635 #endif /* __KERNEL__ */
636
637 quota_interface_t mdc_quota_interface = {
638         .quota_ctl      = client_quota_ctl,
639         .quota_check    = client_quota_check,
640         .quota_poll_check = client_quota_poll_check,
641 };
642
643 quota_interface_t osc_quota_interface = {
644         .quota_ctl      = client_quota_ctl,
645         .quota_check    = client_quota_check,
646         .quota_poll_check = client_quota_poll_check,
647         .quota_init     = osc_quota_init,
648         .quota_exit     = osc_quota_exit,
649         .quota_chkdq    = osc_quota_chkdq,
650         .quota_setdq    = osc_quota_setdq,
651         .quota_cleanup  = osc_quota_cleanup,
652 };
653
654 quota_interface_t lov_quota_interface = {
655         .quota_check    = lov_quota_check,
656         .quota_ctl      = lov_quota_ctl,
657 };
658
659 #ifdef __KERNEL__
660 static int __init init_lustre_quota(void)
661 {
662         int rc = qunit_cache_init();
663         if (rc)
664                 return rc;
665         PORTAL_SYMBOL_REGISTER(filter_quota_interface);
666         PORTAL_SYMBOL_REGISTER(mds_quota_interface);
667         PORTAL_SYMBOL_REGISTER(mdc_quota_interface);
668         PORTAL_SYMBOL_REGISTER(osc_quota_interface);
669         PORTAL_SYMBOL_REGISTER(lov_quota_interface);
670         return 0;
671 }
672
673 static void /*__exit*/ exit_lustre_quota(void)
674 {
675         PORTAL_SYMBOL_UNREGISTER(filter_quota_interface);
676         PORTAL_SYMBOL_UNREGISTER(mds_quota_interface);
677         PORTAL_SYMBOL_UNREGISTER(mdc_quota_interface);
678         PORTAL_SYMBOL_UNREGISTER(osc_quota_interface);
679         PORTAL_SYMBOL_UNREGISTER(lov_quota_interface);
680
681         qunit_cache_cleanup();
682 }
683
684 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
685 MODULE_DESCRIPTION("Lustre Quota");
686 MODULE_LICENSE("GPL");
687
688 cfs_module(lquota, "1.0.0", init_lustre_quota, exit_lustre_quota);
689
690 EXPORT_SYMBOL(mds_quota_interface);
691 EXPORT_SYMBOL(filter_quota_interface);
692 EXPORT_SYMBOL(mdc_quota_interface);
693 EXPORT_SYMBOL(osc_quota_interface);
694 EXPORT_SYMBOL(lov_quota_interface);
695 #endif /* __KERNEL */