1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * lustre/quota/quota_interface.c
6 * Copyright (c) 2001-2005 Cluster File Systems, Inc.
8 * This file is part of Lustre, http://www.lustre.org.
10 * No redistribution or use is permitted outside of Cluster File Systems, Inc.
14 # define EXPORT_SYMTAB
16 #define DEBUG_SUBSYSTEM S_MDS
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 # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
26 # include <linux/smp_lock.h>
27 # include <linux/buffer_head.h>
28 # include <linux/workqueue.h>
29 # include <linux/mount.h>
31 # include <linux/locks.h>
33 #else /* __KERNEL__ */
34 # include <liblustre.h>
37 #include <obd_class.h>
38 #include <lustre_mds.h>
39 #include <lustre_dlm.h>
40 #include <lustre_cfg.h>
42 #include <lustre_fsfilt.h>
43 #include <lustre_quota.h>
44 #include <lprocfs_status.h>
45 #include "quota_internal.h"
50 /* quota proc file handling functions */
56 #define MAX_STYPE_SIZE 5
57 int lprocfs_quota_rd_type(char *page, char **start, off_t off, int count,
60 struct obd_device *obd = (struct obd_device *)data;
61 char stype[MAX_STYPE_SIZE + 1] = "";
62 int type = obd->u.obt.obt_qctxt.lqc_atype;
68 if (type & USER_QUOTA)
70 if (type & GROUP_QUOTA)
74 /* append with quota version on MDS */
75 if (!strcmp(obd->obd_type->typ_name, LUSTRE_MDS_NAME)) {
77 lustre_quota_version_t version;
79 rc = mds_quota_get_version(obd, &version);
95 return snprintf(page, count, "%s\n", stype);
97 EXPORT_SYMBOL(lprocfs_quota_rd_type);
99 static int auto_quota_on(struct obd_device *obd, int type,
100 struct super_block *sb, int is_master)
102 struct obd_quotactl *oqctl;
103 struct lvfs_run_ctxt saved;
107 LASSERT(type == USRQUOTA || type == GRPQUOTA || type == UGQUOTA);
109 /* quota already turned on */
110 if (obd->u.obt.obt_qctxt.lqc_status)
113 OBD_ALLOC_PTR(oqctl);
117 oqctl->qc_type = type;
118 oqctl->qc_cmd = Q_QUOTAON;
119 oqctl->qc_id = QFMT_LDISKFS;
121 push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
126 /* turn on cluster wide quota */
127 rc = mds_admin_quota_on(obd, oqctl);
129 CDEBUG(rc == -ENOENT ? D_QUOTA : D_ERROR,
130 "auto-enable admin quota failed. rc=%d\n", rc);
134 /* turn on local quota */
135 rc = fsfilt_quotactl(obd, sb, oqctl);
137 CDEBUG(rc == -ENOENT ? D_QUOTA : D_ERROR,
138 "auto-enable local quota failed. rc=%d\n", rc);
140 mds_quota_off(obd, oqctl);
142 obd->u.obt.obt_qctxt.lqc_status = 1;
145 pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
151 int lprocfs_quota_wr_type(struct file *file, const char *buffer,
152 unsigned long count, void *data)
154 struct obd_device *obd = (struct obd_device *)data;
155 struct obd_device_target *obt = &obd->u.obt;
158 char stype[MAX_STYPE_SIZE + 1] = "";
159 LASSERT(obd != NULL);
161 if (count > MAX_STYPE_SIZE)
164 if (copy_from_user(stype, buffer, count))
167 for (i = 0 ; i < count ; i++) {
177 /* quota version specifiers */
179 if (strcmp(obd->obd_type->typ_name, LUSTRE_MDS_NAME))
182 rc = mds_quota_set_version(obd, LUSTRE_QUOTA_V1);
184 CDEBUG(D_QUOTA, "failed to set quota v1! %d\n", rc);
189 if (strcmp(obd->obd_type->typ_name, LUSTRE_MDS_NAME))
192 rc = mds_quota_set_version(obd, LUSTRE_QUOTA_V2);
194 CDEBUG(D_QUOTA, "could not set quota v2! %d\n", rc);
198 default : /* just skip stray symbols like \n */
203 obt->obt_qctxt.lqc_atype = type;
208 if (!strcmp(obd->obd_type->typ_name, LUSTRE_MDS_NAME))
209 auto_quota_on(obd, type - 1, obt->obt_sb, 1);
210 else if (!strcmp(obd->obd_type->typ_name, LUSTRE_OST_NAME))
211 auto_quota_on(obd, type - 1, obt->obt_sb, 0);
217 EXPORT_SYMBOL(lprocfs_quota_wr_type);
222 static int filter_quota_setup(struct obd_device *obd)
225 struct obd_device_target *obt = &obd->u.obt;
228 atomic_set(&obt->obt_quotachecking, 1);
229 rc = qctxt_init(&obt->obt_qctxt, obt->obt_sb, NULL);
231 CERROR("initialize quota context failed! (rc:%d)\n", rc);
237 static int filter_quota_cleanup(struct obd_device *obd)
239 qctxt_cleanup(&obd->u.obt.obt_qctxt, 0);
243 static int filter_quota_setinfo(struct obd_export *exp, struct obd_device *obd)
245 struct obd_import *imp;
247 /* setup the quota context import */
248 spin_lock(&obd->u.obt.obt_qctxt.lqc_lock);
249 obd->u.obt.obt_qctxt.lqc_import = exp->exp_imp_reverse;
250 spin_unlock(&obd->u.obt.obt_qctxt.lqc_lock);
252 /* make imp's connect flags equal relative exp's connect flags
253 * adding it to avoid the scan export list
255 imp = exp->exp_imp_reverse;
257 imp->imp_connect_data.ocd_connect_flags |=
258 (exp->exp_connect_flags &
259 (OBD_CONNECT_QUOTA64 | OBD_CONNECT_CHANGE_QS));
261 /* start quota slave recovery thread. (release high limits) */
262 qslave_start_recovery(obd, &obd->u.obt.obt_qctxt);
266 static int filter_quota_clearinfo(struct obd_export *exp, struct obd_device *obd)
268 struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt;
270 /* when exp->exp_imp_reverse is destroyed, the corresponding lqc_import
271 * should be invalid b=12374 */
272 if (qctxt->lqc_import == exp->exp_imp_reverse) {
273 spin_lock(&qctxt->lqc_lock);
274 qctxt->lqc_import = NULL;
275 spin_unlock(&qctxt->lqc_lock);
281 static int filter_quota_enforce(struct obd_device *obd, unsigned int ignore)
285 if (!sb_any_quota_enabled(obd->u.obt.obt_sb))
289 cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
291 cap_lower(current->cap_effective, CAP_SYS_RESOURCE);
296 static int filter_quota_getflag(struct obd_device *obd, struct obdo *oa)
298 struct obd_device_target *obt = &obd->u.obt;
299 int err, cnt, rc = 0;
300 struct obd_quotactl *oqctl;
303 if (!sb_any_quota_enabled(obt->obt_sb))
306 oa->o_flags &= ~(OBD_FL_NO_USRQUOTA | OBD_FL_NO_GRPQUOTA);
308 OBD_ALLOC_PTR(oqctl);
310 CERROR("Not enough memory!");
314 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
315 memset(oqctl, 0, sizeof(*oqctl));
317 oqctl->qc_cmd = Q_GETQUOTA;
318 oqctl->qc_type = cnt;
319 oqctl->qc_id = (cnt == USRQUOTA) ? oa->o_uid : oa->o_gid;
320 err = fsfilt_quotactl(obd, obt->obt_sb, oqctl);
327 /* set over quota flags for a uid/gid */
328 oa->o_valid |= (cnt == USRQUOTA) ?
329 OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA;
330 if (oqctl->qc_dqblk.dqb_bhardlimit &&
331 (toqb(oqctl->qc_dqblk.dqb_curspace) >
332 oqctl->qc_dqblk.dqb_bhardlimit))
333 oa->o_flags |= (cnt == USRQUOTA) ?
334 OBD_FL_NO_USRQUOTA : OBD_FL_NO_GRPQUOTA;
340 static int filter_quota_acquire(struct obd_device *obd, unsigned int uid,
343 struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt;
347 rc = qctxt_adjust_qunit(obd, qctxt, uid, gid, LQUOTA_FLAGS_BLK, 1);
351 /* check whether the left quota of certain uid and gid can satisfy a block_write
352 * or inode_create rpc. When need to acquire quota, return QUOTA_RET_ACQUOTA */
353 static int quota_check_common(struct obd_device *obd, unsigned int uid,
354 unsigned int gid, int count, int cycle, int isblk)
356 struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt;
358 __u32 id[MAXQUOTAS] = { uid, gid };
359 struct qunit_data qdata[MAXQUOTAS];
360 int rc = 0, rc2[2] = { 0, 0 };
363 CLASSERT(MAXQUOTAS < 4);
364 if (!sb_any_quota_enabled(qctxt->lqc_sb))
367 for (i = 0; i < MAXQUOTAS; i++) {
368 struct lustre_qunit_size *lqs = NULL;
370 qdata[i].qd_id = id[i];
371 qdata[i].qd_flags = i;
373 QDATA_SET_BLK(&qdata[i]);
374 qdata[i].qd_count = 0;
376 /* ignore root user */
377 if (qdata[i].qd_id == 0 && !QDATA_IS_GRP(&qdata[i]))
380 quota_search_lqs(&qdata[i], NULL, qctxt, &lqs);
384 rc2[i] = compute_remquota(obd, qctxt, &qdata[i], isblk);
385 spin_lock(&lqs->lqs_lock);
387 rc = QUOTA_RET_INC_PENDING;
389 lqs->lqs_bwrite_pending += count;
391 lqs->lqs_iwrite_pending += count;
394 CDEBUG(D_QUOTA, "write pending: %lu, qd_count: "LPU64".\n",
395 isblk ? lqs->lqs_bwrite_pending : lqs->lqs_iwrite_pending,
397 if (rc2[i] == QUOTA_RET_OK) {
398 if (isblk && qdata[i].qd_count <
399 lqs->lqs_bwrite_pending * CFS_PAGE_SIZE)
400 rc2[i] = QUOTA_RET_ACQUOTA;
401 if (!isblk && qdata[i].qd_count <
402 lqs->lqs_iwrite_pending)
403 rc2[i] = QUOTA_RET_ACQUOTA;
406 spin_unlock(&lqs->lqs_lock);
410 if (rc2[0] == QUOTA_RET_ACQUOTA || rc2[1] == QUOTA_RET_ACQUOTA)
411 RETURN(rc | QUOTA_RET_ACQUOTA);
416 static int quota_chk_acq_common(struct obd_device *obd, unsigned int uid,
417 unsigned int gid, int count, int *pending,
418 int isblk, quota_acquire acquire)
420 int rc = 0, cycle = 0;
423 while ((rc = quota_check_common(obd, uid, gid, count, cycle, isblk)) &
426 if (rc & QUOTA_RET_INC_PENDING)
431 OBD_FAIL_TIMEOUT(OBD_FAIL_OST_HOLD_WRITE_RPC, 90);
432 rc = acquire(obd, uid, gid);
434 /* please reference to dqacq_completion for the below */
435 /* a new request is finished, try again */
437 CDEBUG(D_QUOTA, "finish a quota req, try again\n");
441 /* it is out of quota already */
443 CDEBUG(D_QUOTA, "out of quota, return -EDQUOT\n");
447 /* -EBUSY and others, try 10 times */
448 if (rc < 0 && cycle < 10) {
449 CDEBUG(D_QUOTA, "rc: %d, cycle: %d\n", rc, cycle);
450 cfs_schedule_timeout(CFS_TASK_INTERRUPTIBLE, HZ);
454 CDEBUG(D_QUOTA, "exit with rc: %d\n", rc);
458 if (!cycle && rc & QUOTA_RET_INC_PENDING)
465 static int filter_quota_check(struct obd_device *obd, unsigned int uid,
466 unsigned int gid, int npage, int *flag,
467 quota_acquire acquire)
469 return quota_chk_acq_common(obd, uid, gid, npage, flag, LQUOTA_FLAGS_BLK,
473 /* when a block_write or inode_create rpc is finished, adjust the record for
474 * pending blocks and inodes*/
475 static int quota_pending_commit(struct obd_device *obd, unsigned int uid,
476 unsigned int gid, int count, int isblk)
478 struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt;
480 __u32 id[MAXQUOTAS] = { uid, gid };
481 struct qunit_data qdata[MAXQUOTAS];
484 CLASSERT(MAXQUOTAS < 4);
485 if (!sb_any_quota_enabled(qctxt->lqc_sb))
488 for (i = 0; i < MAXQUOTAS; i++) {
489 struct lustre_qunit_size *lqs = NULL;
491 qdata[i].qd_id = id[i];
492 qdata[i].qd_flags = i;
494 QDATA_SET_BLK(&qdata[i]);
495 qdata[i].qd_count = 0;
497 if (qdata[i].qd_id == 0 && !QDATA_IS_GRP(&qdata[i]))
500 quota_search_lqs(&qdata[i], NULL, qctxt, &lqs);
502 spin_lock(&lqs->lqs_lock);
503 CDEBUG(D_QUOTA, "pending: %lu, count: %d.\n",
504 isblk ? lqs->lqs_bwrite_pending :
505 lqs->lqs_iwrite_pending, count);
508 if (lqs->lqs_bwrite_pending >= count)
509 lqs->lqs_bwrite_pending -= count;
512 "there are too many blocks!\n");
514 if (lqs->lqs_iwrite_pending >= count)
515 lqs->lqs_iwrite_pending -= count;
518 "there are too many files!\n");
521 spin_unlock(&lqs->lqs_lock);
529 static int filter_quota_pending_commit(struct obd_device *obd, unsigned int uid,
530 unsigned int gid, int npage)
532 return quota_pending_commit(obd, uid, gid, npage, LQUOTA_FLAGS_BLK);
535 static int mds_quota_init(void)
537 return lustre_dquot_init();
540 static int mds_quota_exit(void)
546 static int mds_quota_setup(struct obd_device *obd)
548 struct obd_device_target *obt = &obd->u.obt;
549 struct mds_obd *mds = &obd->u.mds;
553 mds->mds_quota_info.qi_version = LUSTRE_QUOTA_V2;
554 atomic_set(&obt->obt_quotachecking, 1);
555 /* initialize quota master and quota context */
556 sema_init(&mds->mds_qonoff_sem, 1);
557 rc = qctxt_init(&obt->obt_qctxt, obt->obt_sb, dqacq_handler);
559 CERROR("initialize quota context failed! (rc:%d)\n", rc);
565 static int mds_quota_cleanup(struct obd_device *obd)
567 qctxt_cleanup(&obd->u.obt.obt_qctxt, 0);
571 static int mds_quota_fs_cleanup(struct obd_device *obd)
573 struct mds_obd *mds = &obd->u.mds;
577 /* close admin quota files */
578 down(&mds->mds_qonoff_sem);
579 for (i = 0; i < MAXQUOTAS; i++) {
580 if (mds->mds_quota_info.qi_files[i]) {
581 filp_close(mds->mds_quota_info.qi_files[i], 0);
582 mds->mds_quota_info.qi_files[i] = NULL;
585 up(&mds->mds_qonoff_sem);
589 static int mds_quota_check(struct obd_device *obd, unsigned int uid,
590 unsigned int gid, int inodes, int *flag,
591 quota_acquire acquire)
593 return quota_chk_acq_common(obd, uid, gid, inodes, flag, 0, acquire);
596 static int mds_quota_acquire(struct obd_device *obd, unsigned int uid,
599 struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt;
603 rc = qctxt_adjust_qunit(obd, qctxt, uid, gid, 0, 1);
607 static int mds_quota_pending_commit(struct obd_device *obd, unsigned int uid,
608 unsigned int gid, int inodes)
610 return quota_pending_commit(obd, uid, gid, inodes, 0);
612 #endif /* __KERNEL__ */
614 struct osc_quota_info {
615 struct list_head oqi_hash; /* hash list */
616 struct client_obd *oqi_cli; /* osc obd */
617 unsigned int oqi_id; /* uid/gid of a file */
618 short oqi_type; /* quota type */
621 spinlock_t qinfo_list_lock = SPIN_LOCK_UNLOCKED;
623 static struct list_head qinfo_hash[NR_DQHASH];
624 /* SLAB cache for client quota context */
625 cfs_mem_cache_t *qinfo_cachep = NULL;
627 static inline int hashfn(struct client_obd *cli, unsigned long id, int type)
628 __attribute__((__const__));
630 static inline int hashfn(struct client_obd *cli, unsigned long id, int type)
632 unsigned long tmp = ((unsigned long)cli>>6) ^ id;
633 tmp = (tmp * (MAXQUOTAS - type)) % NR_DQHASH;
637 /* caller must hold qinfo_list_lock */
638 static inline void insert_qinfo_hash(struct osc_quota_info *oqi)
640 struct list_head *head = qinfo_hash +
641 hashfn(oqi->oqi_cli, oqi->oqi_id, oqi->oqi_type);
643 LASSERT_SPIN_LOCKED(&qinfo_list_lock);
644 list_add(&oqi->oqi_hash, head);
647 /* caller must hold qinfo_list_lock */
648 static inline void remove_qinfo_hash(struct osc_quota_info *oqi)
650 LASSERT_SPIN_LOCKED(&qinfo_list_lock);
651 list_del_init(&oqi->oqi_hash);
654 /* caller must hold qinfo_list_lock */
655 static inline struct osc_quota_info *find_qinfo(struct client_obd *cli,
656 unsigned int id, int type)
658 unsigned int hashent = hashfn(cli, id, type);
659 struct osc_quota_info *oqi;
661 LASSERT_SPIN_LOCKED(&qinfo_list_lock);
662 list_for_each_entry(oqi, &qinfo_hash[hashent], oqi_hash) {
663 if (oqi->oqi_cli == cli &&
664 oqi->oqi_id == id && oqi->oqi_type == type)
670 static struct osc_quota_info *alloc_qinfo(struct client_obd *cli,
671 unsigned int id, int type)
673 struct osc_quota_info *oqi;
676 OBD_SLAB_ALLOC(oqi, qinfo_cachep, CFS_ALLOC_STD, sizeof(*oqi));
680 INIT_LIST_HEAD(&oqi->oqi_hash);
683 oqi->oqi_type = type;
688 static void free_qinfo(struct osc_quota_info *oqi)
690 OBD_SLAB_FREE(oqi, qinfo_cachep, sizeof(*oqi));
693 int osc_quota_chkdq(struct client_obd *cli,
694 unsigned int uid, unsigned int gid)
697 int cnt, rc = QUOTA_OK;
700 spin_lock(&qinfo_list_lock);
701 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
702 struct osc_quota_info *oqi = NULL;
704 id = (cnt == USRQUOTA) ? uid : gid;
705 oqi = find_qinfo(cli, id, cnt);
711 spin_unlock(&qinfo_list_lock);
716 int osc_quota_setdq(struct client_obd *cli,
717 unsigned int uid, unsigned int gid,
718 obd_flag valid, obd_flag flags)
726 for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
727 struct osc_quota_info *oqi, *old;
729 if (!(valid & ((cnt == USRQUOTA) ?
730 OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA)))
733 id = (cnt == USRQUOTA) ? uid : gid;
734 noquota = (cnt == USRQUOTA) ?
735 (flags & OBD_FL_NO_USRQUOTA) : (flags & OBD_FL_NO_GRPQUOTA);
737 oqi = alloc_qinfo(cli, id, cnt);
739 spin_lock(&qinfo_list_lock);
741 old = find_qinfo(cli, id, cnt);
743 remove_qinfo_hash(old);
744 else if (!old && noquota)
745 insert_qinfo_hash(oqi);
747 spin_unlock(&qinfo_list_lock);
754 CERROR("not enough mem!\n");
763 int osc_quota_cleanup(struct obd_device *obd)
765 struct client_obd *cli = &obd->u.cli;
766 struct osc_quota_info *oqi, *n;
770 spin_lock(&qinfo_list_lock);
771 for (i = 0; i < NR_DQHASH; i++) {
772 list_for_each_entry_safe(oqi, n, &qinfo_hash[i], oqi_hash) {
773 if (oqi->oqi_cli != cli)
775 remove_qinfo_hash(oqi);
779 spin_unlock(&qinfo_list_lock);
784 int osc_quota_init(void)
789 LASSERT(qinfo_cachep == NULL);
790 qinfo_cachep = cfs_mem_cache_create("osc_quota_info",
791 sizeof(struct osc_quota_info),
796 for (i = 0; i < NR_DQHASH; i++)
797 INIT_LIST_HEAD(qinfo_hash + i);
802 int osc_quota_exit(void)
804 struct osc_quota_info *oqi, *n;
808 spin_lock(&qinfo_list_lock);
809 for (i = 0; i < NR_DQHASH; i++) {
810 list_for_each_entry_safe(oqi, n, &qinfo_hash[i], oqi_hash) {
811 remove_qinfo_hash(oqi);
815 spin_unlock(&qinfo_list_lock);
817 rc = cfs_mem_cache_destroy(qinfo_cachep);
818 LASSERTF(rc == 0, "couldn't destory qinfo_cachep slab\n");
825 quota_interface_t mds_quota_interface = {
826 .quota_init = mds_quota_init,
827 .quota_exit = mds_quota_exit,
828 .quota_setup = mds_quota_setup,
829 .quota_cleanup = mds_quota_cleanup,
830 .quota_check = target_quota_check,
831 .quota_ctl = mds_quota_ctl,
832 .quota_fs_cleanup =mds_quota_fs_cleanup,
833 .quota_recovery = mds_quota_recovery,
834 .quota_adjust = mds_quota_adjust,
835 .quota_chkquota = mds_quota_check,
836 .quota_acquire = mds_quota_acquire,
837 .quota_pending_commit = mds_quota_pending_commit,
840 quota_interface_t filter_quota_interface = {
841 .quota_setup = filter_quota_setup,
842 .quota_cleanup = filter_quota_cleanup,
843 .quota_check = target_quota_check,
844 .quota_ctl = filter_quota_ctl,
845 .quota_setinfo = filter_quota_setinfo,
846 .quota_clearinfo = filter_quota_clearinfo,
847 .quota_enforce = filter_quota_enforce,
848 .quota_getflag = filter_quota_getflag,
849 .quota_acquire = filter_quota_acquire,
850 .quota_adjust = filter_quota_adjust,
851 .quota_chkquota = filter_quota_check,
852 .quota_adjust_qunit = filter_quota_adjust_qunit,
853 .quota_pending_commit = filter_quota_pending_commit,
855 #endif /* __KERNEL__ */
857 quota_interface_t mdc_quota_interface = {
858 .quota_ctl = client_quota_ctl,
859 .quota_check = client_quota_check,
860 .quota_poll_check = client_quota_poll_check,
863 quota_interface_t osc_quota_interface = {
864 .quota_ctl = client_quota_ctl,
865 .quota_check = client_quota_check,
866 .quota_poll_check = client_quota_poll_check,
867 .quota_init = osc_quota_init,
868 .quota_exit = osc_quota_exit,
869 .quota_chkdq = osc_quota_chkdq,
870 .quota_setdq = osc_quota_setdq,
871 .quota_cleanup = osc_quota_cleanup,
872 .quota_adjust_qunit = client_quota_adjust_qunit,
875 quota_interface_t lov_quota_interface = {
876 .quota_check = lov_quota_check,
877 .quota_ctl = lov_quota_ctl,
878 .quota_adjust_qunit = lov_quota_adjust_qunit,
882 static int __init init_lustre_quota(void)
884 int rc = qunit_cache_init();
887 PORTAL_SYMBOL_REGISTER(filter_quota_interface);
888 PORTAL_SYMBOL_REGISTER(mds_quota_interface);
889 PORTAL_SYMBOL_REGISTER(mdc_quota_interface);
890 PORTAL_SYMBOL_REGISTER(osc_quota_interface);
891 PORTAL_SYMBOL_REGISTER(lov_quota_interface);
895 static void /*__exit*/ exit_lustre_quota(void)
897 PORTAL_SYMBOL_UNREGISTER(filter_quota_interface);
898 PORTAL_SYMBOL_UNREGISTER(mds_quota_interface);
899 PORTAL_SYMBOL_UNREGISTER(mdc_quota_interface);
900 PORTAL_SYMBOL_UNREGISTER(osc_quota_interface);
901 PORTAL_SYMBOL_UNREGISTER(lov_quota_interface);
903 qunit_cache_cleanup();
906 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
907 MODULE_DESCRIPTION("Lustre Quota");
908 MODULE_LICENSE("GPL");
910 cfs_module(lquota, "1.0.0", init_lustre_quota, exit_lustre_quota);
912 EXPORT_SYMBOL(mds_quota_interface);
913 EXPORT_SYMBOL(filter_quota_interface);
914 EXPORT_SYMBOL(mdc_quota_interface);
915 EXPORT_SYMBOL(osc_quota_interface);
916 EXPORT_SYMBOL(lov_quota_interface);
917 #endif /* __KERNEL */