From 564a36503c7c3c682d1e44630e87de7c271f9687 Mon Sep 17 00:00:00 2001 From: anserper Date: Tue, 13 May 2008 08:08:48 +0000 Subject: [PATCH] Branch b1_6 b=15238 i=shadow i=tianzy refactoring of quota code --- lustre/quota/quota_interface.c | 13 +++++-------- lustre/quota/quota_internal.h | 1 + lustre/quota/quota_master.c | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lustre/quota/quota_interface.c b/lustre/quota/quota_interface.c index af3c6f5..4680496 100644 --- a/lustre/quota/quota_interface.c +++ b/lustre/quota/quota_interface.c @@ -603,17 +603,14 @@ static int mds_quota_cleanup(struct obd_device *obd) static int mds_quota_fs_cleanup(struct obd_device *obd) { struct mds_obd *mds = &obd->u.mds; - int i; + struct obd_quotactl oqctl; ENTRY; - /* close admin quota files */ + memset(&oqctl, 0, sizeof(oqctl)); + oqctl.qc_type = UGQUOTA; + down(&mds->mds_qonoff_sem); - for (i = 0; i < MAXQUOTAS; i++) { - if (mds->mds_quota_info.qi_files[i]) { - filp_close(mds->mds_quota_info.qi_files[i], 0); - mds->mds_quota_info.qi_files[i] = NULL; - } - } + mds_admin_quota_off(obd, &oqctl); up(&mds->mds_qonoff_sem); RETURN(0); } diff --git a/lustre/quota/quota_internal.h b/lustre/quota/quota_internal.h index d269c0b..3b32102 100644 --- a/lustre/quota/quota_internal.h +++ b/lustre/quota/quota_internal.h @@ -102,6 +102,7 @@ int mds_quota_invalidate(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_admin_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl); +int mds_admin_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_set_dqinfo(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_get_dqinfo(struct obd_device *obd, struct obd_quotactl *oqctl); int mds_set_dqblk(struct obd_device *obd, struct obd_quotactl *oqctl); diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index 31dc70f..2ae2718 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -810,8 +810,8 @@ int mds_admin_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl) RETURN(rc); } -static int mds_admin_quota_off(struct obd_device *obd, - struct obd_quotactl *oqctl) +int mds_admin_quota_off(struct obd_device *obd, + struct obd_quotactl *oqctl) { struct mds_obd *mds = &obd->u.mds; struct lustre_quota_info *qinfo = &mds->mds_quota_info; -- 1.8.3.1