is_needed = true;
break;
}
- CDEBUG(D_HSM, "fid="DFID" action=%s rq_flags="LPX64
- " extent="LPX64"-"LPX64" hsm_flags=%X %s\n",
+ CDEBUG(D_HSM, "fid="DFID" action=%s rq_flags=%#llx"
+ " extent=%#llx-%#llx hsm_flags=%X %s\n",
PFID(&hai->hai_fid),
hsm_copytool_action2name(hai->hai_action), rq_flags,
hai->hai_extent.offset, hai->hai_extent.length,
int rc;
ENTRY;
- if (hsma != HSMA_RESTORE &&
- exp_connect_flags(mti->mti_exp) & OBD_CONNECT_RDONLY)
+ if (hsma != HSMA_RESTORE && mdt_rdonly(mti->mti_exp))
RETURN(-EROFS);
if (md_capable(uc, CFS_CAP_SYS_ADMIN))
}
/**
- * get running action on a FID list or from cookie
- * \param mti [IN]
- * \param hal [IN/OUT] requests
- * \retval 0 success
- * \retval -ve failure
- */
-int mdt_hsm_get_running(struct mdt_thread_info *mti,
- struct hsm_action_list *hal)
-{
- struct mdt_device *mdt = mti->mti_mdt;
- struct coordinator *cdt = &mdt->mdt_coordinator;
- struct hsm_action_item *hai;
- int i;
- ENTRY;
-
- hai = hai_first(hal);
- for (i = 0; i < hal->hal_count; i++, hai = hai_next(hai)) {
- struct cdt_agent_req *car;
-
- if (!fid_is_sane(&hai->hai_fid))
- RETURN(-EINVAL);
-
- car = mdt_cdt_find_request(cdt, 0, &hai->hai_fid);
- if (car == NULL) {
- hai->hai_cookie = 0;
- hai->hai_action = HSMA_NONE;
- } else {
- *hai = *car->car_hai;
- mdt_cdt_put_request(car);
- }
- }
- RETURN(0);
-}
-
-/**
* check if a restore is running on a FID
* this is redundant with mdt_hsm_coordinator_get_running()
* but as it can be called frequently when getting attr
for (i = 0; i < hal->hal_count; i++, hai = hai_next(hai)) {
struct cdt_agent_req *car;
- car = mdt_cdt_find_request(cdt, hai->hai_cookie, NULL);
+ car = mdt_cdt_find_request(cdt, hai->hai_cookie);
if (car == NULL) {
hai->hai_cookie = 0;
} else {