/* pointer to ldlm namespace to be used for quota locks */
struct ldlm_namespace *qmt_ns;
- /* Hash table containing a qmt_pool_info structure for each pool
- * this quota master is in charge of. We only have 2 pools in this
- * hash for the time being:
- * - one for quota management on the default metadata pool
- * - one for quota managment on the default data pool
- *
- * Once we support quota on non-default pools, then more pools will
- * be added to this hash table and pool master setup would have to be
- * handled via configuration logs */
- struct cfs_hash *qmt_pool_hash;
-
/* List of pools managed by this master target */
struct list_head qmt_pool_list;
/* rw semaphore to protect pool list */
QMT_STYPE_CNT
};
+#define qmt_dom(rtype, stype) \
+ ((rtype == LQUOTA_RES_DT && \
+ stype == QMT_STYPE_MDT) ? true : false)
+
enum {
/* set while recalc_thread is working */
QPI_FLAG_RECALC_OFFSET,
+ QPI_FLAG_STATE_INITED,
};
/*
union qmt_sarray qpi_sarr;
/* recalculation thread pointer */
- struct ptlrpc_thread qpi_recalc_thread;
+ struct task_struct *qpi_recalc_task;
/* rw semaphore to avoid acquire/release during
* pool recalculation. */
struct rw_semaphore qpi_recalc_sem;
}
#define qti_lqes_num(env) (qmt_info(env)->qti_lqes_num)
+#define qti_lqes_inited(env) (qmt_info(env)->qti_lqes_num)
#define qti_lqes_cnt(env) (qmt_info(env)->qti_lqes_cnt)
#define qti_glbl_lqe_idx(env) (qmt_info(env)->qti_glbl_lqe_idx)
#define qti_lqes(env) (qti_lqes_num(env) > QMT_MAX_POOL_NUM ? \
unsigned int qmt_sarr_count(struct qmt_pool_info *qpi);
/* qmt_entry.c */
-extern struct lquota_entry_operations qmt_lqe_ops;
+extern const struct lquota_entry_operations qmt_lqe_ops;
int qmt_lqe_set_default(const struct lu_env *env, struct qmt_pool_info *pool,
struct lquota_entry *lqe, bool create_record);
struct thandle *qmt_trans_start_with_slv(const struct lu_env *,
bool qmt_adjust_edquot(struct lquota_entry *, __u64);
#define qmt_adjust_edquot_notify(env, qmt, now, qb_flags) \
- qmt_adjust_edquot_qunit_notify(env, qmt, now, true, false, qb_flags)
-#define qmt_adjust_qunit_notify(env, qmt, qb_flags) \
- qmt_adjust_edquot_qunit_notify(env, qmt, 0, false, true, qb_flags)
-#define qmt_adjust_and_notify(env, qmt, now, qb_flags) \
- qmt_adjust_edquot_qunit_notify(env, qmt, now, true, true, qb_flags)
+ qmt_adjust_edquot_qunit_notify(env, qmt, now, true, \
+ false, qb_flags, -1)
+#define qmt_adjust_notify_nu(env, qmt, now, qb_flags, idx) \
+ qmt_adjust_edquot_qunit_notify(env, qmt, now, true, \
+ true, qb_flags, idx)
bool qmt_adjust_edquot_qunit_notify(const struct lu_env *, struct qmt_device *,
- __u64, bool, bool, __u32);
+ __u64, bool, bool, __u32, int idx);
bool qmt_revalidate(const struct lu_env *, struct lquota_entry *);
void qmt_revalidate_lqes(const struct lu_env *, struct qmt_device *, __u32);
__u64 qmt_alloc_expand(struct lquota_entry *, __u64, __u64);
int qti_lqes_add(const struct lu_env *env, struct lquota_entry *lqe);
void qti_lqes_del(const struct lu_env *env, int index);
void qti_lqes_fini(const struct lu_env *env);
-int qti_lqes_min_qunit(const struct lu_env *env);
+__u64 qti_lqes_min_qunit(const struct lu_env *env);
int qti_lqes_edquot(const struct lu_env *env);
int qti_lqes_restore_init(const struct lu_env *env);
void qti_lqes_restore_fini(const struct lu_env *env);
struct lquota_entry *lqe, __u64 hard, __u64 soft,
__u64 time, __u32 valid, bool is_default, bool is_updated);
int qmt_dqacq0(const struct lu_env *, struct qmt_device *, struct obd_uuid *,
- __u32, __u64, __u64, struct quota_body *);
+ __u32, __u64, __u64, struct quota_body *, int);
int qmt_uuid2idx(struct obd_uuid *, int *);
/* qmt_lock.c */