/* 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 */
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 ? \
/* helper routine to convert a lu_device into a qmt_device */
static inline struct qmt_device *lu2qmt_dev(struct lu_device *ld)
{
- return container_of0(lu2dt_dev(ld), struct qmt_device, qmt_dt_dev);
+ return container_of_safe(lu2dt_dev(ld), struct qmt_device, qmt_dt_dev);
}
/* helper routine to convert a qmt_device into lu_device */
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 *,
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);