Whamcloud - gitweb
LU-13601 llite: avoid needless large stats alloc
[fs/lustre-release.git] / lustre / quota / qmt_internal.h
index 423cda6..7d3b7ce 100644 (file)
@@ -58,17 +58,6 @@ struct qmt_device {
        /* 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 */
@@ -129,7 +118,7 @@ struct qmt_pool_info {
 
        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;
@@ -284,6 +273,7 @@ struct qmt_thread_info *qmt_info(const struct lu_env *env)
 }
 
 #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 ? \
@@ -301,7 +291,7 @@ struct qmt_thread_info *qmt_info(const struct lu_env *env)
 /* 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 */
@@ -462,7 +452,7 @@ int qmt_sarr_get_idx(struct qmt_pool_info *qpi, int arr_idx);
 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 *,
@@ -498,7 +488,7 @@ void qti_lqes_init(const struct lu_env *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);