/**
* check if a request is compatible with file status
* \param hai [IN] request description
- * \param hal_an [IN] request archive number (not used)
+ * \param archive_id [IN] request archive id
* \param rq_flags [IN] request flags
* \param hsm [IN] file HSM metadata
* \retval boolean
*/
bool mdt_hsm_is_action_compat(const struct hsm_action_item *hai,
- const int hal_an, const __u64 rq_flags,
+ u32 archive_id, u64 rq_flags,
const struct md_hsm *hsm)
{
int is_compat = false;
if (!(hsm_flags & HS_NOARCHIVE) &&
(hsm_flags & HS_DIRTY || !(hsm_flags & HS_ARCHIVED)))
is_compat = true;
+
+ if (hsm_flags & HS_EXISTS &&
+ archive_id != 0 &&
+ archive_id != hsm->mh_arch_id)
+ is_compat = false;
+
break;
case HSMA_RESTORE:
if (!(hsm_flags & HS_DIRTY) && (hsm_flags & HS_RELEASED) &&
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,
+ u32 archive_id, u64 rq_flags,
const struct md_hsm *hsm);
int mdt_hsm_update_request_state(struct mdt_thread_info *mti,
struct hsm_progress_kernel *pgs,