/*
* Vector of quota entry operations supported on the master
*/
-struct lquota_entry_operations qmt_lqe_ops = {
+const struct lquota_entry_operations qmt_lqe_ops = {
.lqe_init = qmt_lqe_init,
.lqe_read = qmt_lqe_read,
.lqe_debug = qmt_lqe_debug,
{
struct qmt_thread_info *qti = qmt_info(env);
- if (qti->qti_lqes_cnt > qti->qti_lqes_num) {
+ if (qti->qti_lqes_cnt >= qti->qti_lqes_num) {
struct lquota_entry **lqes;
lqes = qti->qti_lqes;
OBD_ALLOC(lqes, sizeof(lqe) * qti->qti_lqes_num * 2);
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;
return min;
}
-inline int qti_lqes_edquot(const struct lu_env *env)
+int qti_lqes_edquot(const struct lu_env *env)
{
int i;
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))
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;
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;
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