Whamcloud - gitweb
LU-7988 hsm: run HSM coordinator once per second at most
[fs/lustre-release.git] / lustre / mdt / mdt_internal.h
index 20273e3..c67d090 100644 (file)
@@ -129,6 +129,7 @@ static inline char *cdt_mdt_state2str(int state)
 struct coordinator {
        wait_queue_head_t        cdt_waitq;          /**< cdt wait queue */
        bool                     cdt_event;          /**< coordinator event */
+       struct task_struct      *cdt_task;           /**< cdt thread handle */
        struct lu_env            cdt_env;            /**< coordinator lustre
                                                      * env */
        struct lu_context        cdt_session;        /** session for lu_ucred */
@@ -633,11 +634,8 @@ int mdt_reint_object_lock(struct mdt_thread_info *info, struct mdt_object *o,
                          bool cos_incompat);
 
 int mdt_object_lock_try(struct mdt_thread_info *info, struct mdt_object *mo,
-                       struct mdt_lock_handle *lh, __u64 ibits);
-
-int mdt_reint_object_lock_try(struct mdt_thread_info *info,
-                             struct mdt_object *o, struct mdt_lock_handle *lh,
-                             __u64 ibits, bool cos_incompat);
+                       struct mdt_lock_handle *lh, __u64 *ibits,
+                       __u64 trybits, bool cos_incompat);
 
 void mdt_object_unlock(struct mdt_thread_info *info, struct mdt_object *mo,
                       struct mdt_lock_handle *lh, int decref);
@@ -662,8 +660,7 @@ void mdt_client_compatibility(struct mdt_thread_info *info);
 int mdt_remote_object_lock(struct mdt_thread_info *mti,
                           struct mdt_object *o, const struct lu_fid *fid,
                           struct lustre_handle *lh,
-                          enum ldlm_mode mode, __u64 ibits, bool nonblock,
-                          bool cache);
+                          enum ldlm_mode mode, __u64 ibits, bool cache);
 
 enum mdt_name_flags {
        MNF_FIX_ANON = 1,
@@ -897,7 +894,15 @@ struct cdt_restore_handle *mdt_hsm_restore_hdl_find(struct coordinator *cdt,
 int mdt_hsm_cdt_init(struct mdt_device *mdt);
 int mdt_hsm_cdt_stop(struct mdt_device *mdt);
 int mdt_hsm_cdt_fini(struct mdt_device *mdt);
-int mdt_hsm_cdt_wakeup(struct mdt_device *mdt);
+
+/*
+ * Signal the coordinator has work to do
+ * \param cdt [IN] coordinator
+ */
+static inline void mdt_hsm_cdt_event(struct coordinator *cdt)
+{
+       cdt->cdt_event = true;
+}
 
 /* coordinator control /proc interface */
 ssize_t mdt_hsm_cdt_control_seq_write(struct file *file,