X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fquota%2Fqmt_entry.c;h=03dc1d78bb7ddcfffd91e604051dcb060db9fca2;hp=f5b74de1b617b39c17f2387d22aa245af3094af0;hb=d1231c4d6adf6a2d39c62ed684535e86d9a40bc0;hpb=c20b866ba374ea38237f0e0c8f5b1bc9bb370985 diff --git a/lustre/quota/qmt_entry.c b/lustre/quota/qmt_entry.c index f5b74de..03dc1d7 100644 --- a/lustre/quota/qmt_entry.c +++ b/lustre/quota/qmt_entry.c @@ -942,9 +942,12 @@ void qti_lqes_fini(const struct lu_env *env) if (qti->qti_lqes_num > QMT_MAX_POOL_NUM) OBD_FREE(qti->qti_lqes, qti->qti_lqes_num * sizeof(struct lquota_entry *)); + + qti->qti_lqes_num = 0; + qti->qti_lqes_cnt = 0; } -inline int qti_lqes_min_qunit(const struct lu_env *env) +int qti_lqes_min_qunit(const struct lu_env *env) { int i, min, qunit; @@ -957,7 +960,7 @@ inline int qti_lqes_min_qunit(const struct lu_env *env) return min; } -inline int qti_lqes_edquot(const struct lu_env *env) +int qti_lqes_edquot(const struct lu_env *env) { int i; @@ -969,11 +972,11 @@ inline int qti_lqes_edquot(const struct lu_env *env) return 0; } -inline int qti_lqes_restore_init(const struct lu_env *env) +int qti_lqes_restore_init(const struct lu_env *env) { int rc = 0; - if (qti_lqes_cnt(env) > QMT_MAX_POOL_NUM) { + if (qti_lqes_inited(env) && qti_lqes_cnt(env) > QMT_MAX_POOL_NUM) { OBD_ALLOC(qmt_info(env)->qti_lqes_rstr, qti_lqes_cnt(env) * sizeof(struct qmt_lqe_restore)); if (!qti_lqes_rstr(env)) @@ -983,14 +986,14 @@ inline int qti_lqes_restore_init(const struct lu_env *env) return rc; } -inline void qti_lqes_restore_fini(const struct lu_env *env) +void qti_lqes_restore_fini(const struct lu_env *env) { - if (qti_lqes_cnt(env) > QMT_MAX_POOL_NUM) + if (qti_lqes_inited(env) && qti_lqes_cnt(env) > QMT_MAX_POOL_NUM) OBD_FREE(qmt_info(env)->qti_lqes_rstr, qti_lqes_cnt(env) * sizeof(struct qmt_lqe_restore)); } -inline void qti_lqes_write_lock(const struct lu_env *env) +void qti_lqes_write_lock(const struct lu_env *env) { int i; @@ -998,7 +1001,7 @@ inline void qti_lqes_write_lock(const struct lu_env *env) lqe_write_lock(qti_lqes(env)[i]); } -inline void qti_lqes_write_unlock(const struct lu_env *env) +void qti_lqes_write_unlock(const struct lu_env *env) { int i; @@ -1050,6 +1053,8 @@ void qmt_seed_glbe_all(const struct lu_env *env, struct lqe_glbl_data *lgd, int i, j, idx; ENTRY; + if (!qti_lqes_cnt(env)) + RETURN_EXIT; /* lqes array is sorted by qunit - the first entry has minimum qunit. * Thus start seeding global qunit's array beginning from the 1st lqe * and appropriate pool. If pools overlapped, slaves from this