+
+ RETURN(is_running);
+}
+
+struct hsm_get_action_data {
+ const struct lu_fid *hgad_fid;
+ struct hsm_action_item hgad_hai;
+ enum agent_req_status hgad_status;
+};
+
+static int hsm_get_action_cb(const struct lu_env *env,
+ struct llog_handle *llh,
+ struct llog_rec_hdr *hdr, void *data)
+{
+ struct llog_agent_req_rec *larr = (struct llog_agent_req_rec *)hdr;
+ struct hsm_get_action_data *hgad = data;
+
+ /* A compatible request must be WAITING or STARTED and not a
+ * cancel. */
+ if ((larr->arr_status != ARS_WAITING &&
+ larr->arr_status != ARS_STARTED) ||
+ larr->arr_hai.hai_action == HSMA_CANCEL ||
+ !lu_fid_eq(&larr->arr_hai.hai_fid, hgad->hgad_fid))
+ RETURN(0);
+
+ hgad->hgad_hai = larr->arr_hai;
+ hgad->hgad_status = larr->arr_status;
+
+ RETURN(LLOG_PROC_BREAK);