OBD_FREE_PTR(detach);
RETURN(rc);
}
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 18, 53, 0)
case LL_IOC_PCC_STATE: {
struct lu_pcc_state __user *ustate =
(struct lu_pcc_state __user *)arg;
OBD_FREE_PTR(state);
RETURN(rc);
}
-#endif
#ifdef HAVE_LUSTRE_CRYPTO
case LL_IOC_SET_ENCRYPTION_POLICY:
if (!ll_sbi_has_encrypt(ll_i2sbi(inode)))
"ll_fid_path_copy");
}
+static bool abort_copy;
+
struct chunk_data {
ssize_t* copied_total;
int extra_open_flags;
int dst_fd;
};
+#define PERIODIC_CHECK_IOCOUNT 32
+
+static bool check_abort_copy(int fd, int *iocount)
+{
+ if (abort_copy)
+ return true;
+
+ (*iocount)++;
+ if (*iocount >= PERIODIC_CHECK_IOCOUNT) {
+ struct lu_pcc_state state;
+ int rc;
+
+ *iocount = 0;
+ rc = llapi_pcc_state_get_fd(fd, &state);
+ if (rc) {
+ fprintf(stderr,
+ "%s: failed to get PCC state: rc = %d\n",
+ program_invocation_short_name, rc);
+ return false;
+ }
+
+ if (state.pccs_flags & PCC_STATE_FL_ATTACH_ABORTING)
+ abort_copy = true;
+ }
+
+ return abort_copy;
+}
+
void *copy_data_threaded(void *arg)
{
struct chunk_data *chunk = arg;
void* buf = NULL;
ssize_t rc = 0;
long int thread = syscall(__NR_gettid);
+ int iocount = 0;
rc = posix_memalign(&buf, page_size, iosize);
if (rc) {
offset += wsz;
if (offset == end_offset)
break;
+
+ if (check_abort_copy(src_fd, &iocount))
+ break;
}
free(buf);