+int mdt_hsm_state_get(struct tgt_session_info *tsi);
+int mdt_hsm_state_set(struct tgt_session_info *tsi);
+int mdt_hsm_action(struct tgt_session_info *tsi);
+int mdt_hsm_progress(struct tgt_session_info *tsi);
+int mdt_hsm_ct_register(struct tgt_session_info *tsi);
+int mdt_hsm_ct_unregister(struct tgt_session_info *tsi);
+int mdt_hsm_request(struct tgt_session_info *tsi);
+
+/* mdt/mdt_hsm_cdt_actions.c */
+extern const struct file_operations mdt_hsm_actions_fops;
+void dump_llog_agent_req_rec(const char *prefix,
+ const struct llog_agent_req_rec *larr);
+int cdt_llog_process(const struct lu_env *env, struct mdt_device *mdt,
+ llog_cb_t cb, void *data);
+int mdt_agent_record_add(const struct lu_env *env, struct mdt_device *mdt,
+ __u64 compound_id, __u32 archive_id,
+ __u64 flags, struct hsm_action_item *hai);
+int mdt_agent_record_update(const struct lu_env *env,
+ struct mdt_device *mdt, __u64 *cookies,
+ int cookies_count, enum agent_req_status status);
+
+/* mdt/mdt_hsm_cdt_agent.c */
+extern const struct file_operations mdt_hsm_agent_fops;
+int mdt_hsm_agent_register(struct mdt_thread_info *info,
+ const struct obd_uuid *uuid,
+ int nr_archives, __u32 *archive_num);
+int mdt_hsm_agent_register_mask(struct mdt_thread_info *info,
+ const struct obd_uuid *uuid,
+ __u32 archive_mask);
+int mdt_hsm_agent_unregister(struct mdt_thread_info *info,
+ const struct obd_uuid *uuid);
+int mdt_hsm_agent_update_statistics(struct coordinator *cdt,
+ int succ_rq, int fail_rq, int new_rq,
+ const struct obd_uuid *uuid);
+int mdt_hsm_find_best_agent(struct coordinator *cdt, __u32 archive,
+ struct obd_uuid *uuid);
+int mdt_hsm_agent_send(struct mdt_thread_info *mti, struct hsm_action_list *hal,
+ bool purge);
+int mdt_hsm_coordinator_update(struct mdt_thread_info *mti,
+ struct hsm_progress_kernel *pgs);
+/* mdt/mdt_hsm_cdt_client.c */
+int mdt_hsm_add_actions(struct mdt_thread_info *info,
+ struct hsm_action_list *hal, __u64 *compound_id);
+int mdt_hsm_get_actions(struct mdt_thread_info *mti,
+ struct hsm_action_list *hal);
+int mdt_hsm_get_running(struct mdt_thread_info *mti,
+ struct hsm_action_list *hal);
+bool mdt_hsm_restore_is_running(struct mdt_thread_info *mti,
+ const struct lu_fid *fid);
+/* mdt/mdt_hsm_cdt_requests.c */
+extern const struct file_operations mdt_hsm_active_requests_fops;
+void dump_requests(char *prefix, struct coordinator *cdt);
+struct cdt_agent_req *mdt_cdt_alloc_request(__u64 compound_id, __u32 archive_id,
+ __u64 flags, struct obd_uuid *uuid,
+ struct hsm_action_item *hai);
+void mdt_cdt_free_request(struct cdt_agent_req *car);
+int mdt_cdt_add_request(struct coordinator *cdt, struct cdt_agent_req *new_car);
+struct cdt_agent_req *mdt_cdt_find_request(struct coordinator *cdt,
+ const __u64 cookie,
+ const struct lu_fid *fid);
+void mdt_cdt_get_work_done(struct cdt_agent_req *car, __u64 *done_sz);
+void mdt_cdt_get_request(struct cdt_agent_req *car);
+void mdt_cdt_put_request(struct cdt_agent_req *car);
+struct cdt_agent_req *mdt_cdt_update_request(struct coordinator *cdt,
+ const struct hsm_progress_kernel *pgs);
+int mdt_cdt_remove_request(struct coordinator *cdt, __u64 cookie);
+/* mdt/mdt_coordinator.c */
+void mdt_hsm_dump_hal(int level, const char *prefix,
+ struct hsm_action_list *hal);
+/* coordinator management */
+int mdt_hsm_cdt_init(struct mdt_device *mdt);
+int mdt_hsm_cdt_start(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);
+
+/* coordinator control /proc interface */
+ssize_t mdt_hsm_cdt_control_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off);
+int mdt_hsm_cdt_control_seq_show(struct seq_file *m, void *data);
+int hsm_cdt_procfs_init(struct mdt_device *mdt);
+void hsm_cdt_procfs_fini(struct mdt_device *mdt);
+struct lprocfs_vars *hsm_cdt_get_proc_vars(void);
+/* md_hsm helpers */
+struct mdt_object *mdt_hsm_get_md_hsm(struct mdt_thread_info *mti,
+ const struct lu_fid *fid,
+ struct md_hsm *hsm);
+/* actions/request helpers */
+int mdt_hsm_add_hal(struct mdt_thread_info *mti,
+ struct hsm_action_list *hal, struct obd_uuid *uuid);
+bool mdt_hsm_is_action_compat(const struct hsm_action_item *hai,
+ const int hal_an, const __u64 rq_flags,
+ const struct md_hsm *hsm);
+int mdt_hsm_update_request_state(struct mdt_thread_info *mti,
+ struct hsm_progress_kernel *pgs,
+ const int update_record);
+
+int mdt_close_swap_layouts(struct mdt_thread_info *info,
+ struct mdt_object *o, struct md_attr *ma);