Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-1538 tests: fix test cases when OST is full
[fs/lustre-release.git]
/
lustre
/
quota
/
lquota_lib.c
diff --git
a/lustre/quota/lquota_lib.c
b/lustre/quota/lquota_lib.c
index
6ab1f79
..
bc0716e
100644
(file)
--- a/
lustre/quota/lquota_lib.c
+++ b/
lustre/quota/lquota_lib.c
@@
-40,6
+40,19
@@
#include "lquota_internal.h"
#include "lquota_internal.h"
+cfs_mem_cache_t *lqe_kmem;
+
+struct lu_kmem_descr lquota_caches[] = {
+ {
+ .ckd_cache = &lqe_kmem,
+ .ckd_name = "lqe_kmem",
+ .ckd_size = sizeof(struct lquota_entry)
+ },
+ {
+ .ckd_cache = NULL
+ }
+};
+
/* register lquota key */
LU_KEY_INIT_FINI(lquota, struct lquota_thread_info);
LU_CONTEXT_KEY_DEFINE(lquota, LCT_MD_THREAD | LCT_DT_THREAD | LCT_LOCAL);
/* register lquota key */
LU_KEY_INIT_FINI(lquota, struct lquota_thread_info);
LU_CONTEXT_KEY_DEFINE(lquota, LCT_MD_THREAD | LCT_DT_THREAD | LCT_LOCAL);
@@
-244,7
+257,7
@@
void lquota_generate_fid(struct lu_fid *fid, int pool_id, int pool_type,
* Helper routine used to extract pool ID, pool type and quota type from a
* given FID.
*/
* Helper routine used to extract pool ID, pool type and quota type from a
* given FID.
*/
-int lquota_extract_fid(struct lu_fid *fid, int *pool_id, int *pool_type,
+int lquota_extract_fid(
const
struct lu_fid *fid, int *pool_id, int *pool_type,
int *quota_type)
{
unsigned int tmp;
int *quota_type)
{
unsigned int tmp;
@@
-326,14
+339,11
@@
const struct dt_index_features *glb_idx_feature(struct lu_fid *fid)
static int __init init_lquota(void)
{
int rc;
static int __init init_lquota(void)
{
int rc;
+ ENTRY;
lquota_key_init_generic(&lquota_thread_key, NULL);
lu_context_key_register(&lquota_thread_key);
lquota_key_init_generic(&lquota_thread_key, NULL);
lu_context_key_register(&lquota_thread_key);
- rc = qmt_glb_init();
- if (rc)
- return rc;
-
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2,7,50,0)
dt_quota_iusr_features = dt_quota_busr_features = dt_quota_glb_features;
dt_quota_igrp_features = dt_quota_bgrp_features = dt_quota_glb_features;
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2,7,50,0)
dt_quota_iusr_features = dt_quota_busr_features = dt_quota_glb_features;
dt_quota_igrp_features = dt_quota_bgrp_features = dt_quota_glb_features;
@@
-341,12
+351,34
@@
static int __init init_lquota(void)
#warning "remove old quota compatibility code"
#endif
#warning "remove old quota compatibility code"
#endif
- return 0;
+ rc = lu_kmem_init(lquota_caches);
+ if (rc)
+ GOTO(out_key, rc);
+
+ rc = qmt_glb_init();
+ if (rc)
+ GOTO(out_caches, rc);
+
+ rc = qsd_glb_init();
+ if (rc)
+ GOTO(out_qmt, rc);
+
+ RETURN(0);
+
+out_qmt:
+ qmt_glb_fini();
+out_caches:
+ lu_kmem_fini(lquota_caches);
+out_key:
+ lu_context_key_degister(&lquota_thread_key);
+ return rc;
}
static void exit_lquota(void)
{
}
static void exit_lquota(void)
{
+ qsd_glb_fini();
qmt_glb_fini();
qmt_glb_fini();
+ lu_kmem_fini(lquota_caches);
lu_context_key_degister(&lquota_thread_key);
}
lu_context_key_degister(&lquota_thread_key);
}