• Home
  • Raw
  • Download

Lines Matching refs:copy

1108 void nfs4_put_copy(struct nfsd4_copy *copy)  in nfs4_put_copy()  argument
1110 if (!refcount_dec_and_test(&copy->refcount)) in nfs4_put_copy()
1112 kfree(copy); in nfs4_put_copy()
1116 check_and_set_stop_copy(struct nfsd4_copy *copy) in check_and_set_stop_copy() argument
1120 spin_lock(&copy->cp_clp->async_lock); in check_and_set_stop_copy()
1121 value = copy->stopped; in check_and_set_stop_copy()
1122 if (!copy->stopped) in check_and_set_stop_copy()
1123 copy->stopped = true; in check_and_set_stop_copy()
1124 spin_unlock(&copy->cp_clp->async_lock); in check_and_set_stop_copy()
1128 static void nfsd4_stop_copy(struct nfsd4_copy *copy) in nfsd4_stop_copy() argument
1131 if (!check_and_set_stop_copy(copy)) in nfsd4_stop_copy()
1132 kthread_stop(copy->copy_task); in nfsd4_stop_copy()
1133 nfs4_put_copy(copy); in nfsd4_stop_copy()
1138 struct nfsd4_copy *copy = NULL; in nfsd4_get_copy() local
1142 copy = list_first_entry(&clp->async_copies, struct nfsd4_copy, in nfsd4_get_copy()
1144 refcount_inc(&copy->refcount); in nfsd4_get_copy()
1147 return copy; in nfsd4_get_copy()
1152 struct nfsd4_copy *copy; in nfsd4_shutdown_copy() local
1154 while ((copy = nfsd4_get_copy(clp)) != NULL) in nfsd4_shutdown_copy()
1155 nfsd4_stop_copy(copy); in nfsd4_shutdown_copy()
1263 struct nfsd4_copy *copy, struct vfsmount **mount) in nfsd4_setup_inter_ssc() argument
1266 stateid_t *s_stid = &copy->cp_src_stateid; in nfsd4_setup_inter_ssc()
1271 &copy->cp_dst_stateid, in nfsd4_setup_inter_ssc()
1272 WR_STATE, &copy->nf_dst, NULL); in nfsd4_setup_inter_ssc()
1276 status = nfsd4_interssc_connect(&copy->cp_src, rqstp, mount); in nfsd4_setup_inter_ssc()
1282 copy->c_fh.size = s_fh->fh_handle.fh_size; in nfsd4_setup_inter_ssc()
1283 memcpy(copy->c_fh.data, &s_fh->fh_handle.fh_base, copy->c_fh.size); in nfsd4_setup_inter_ssc()
1284 copy->stateid.seqid = cpu_to_be32(s_stid->si_generation); in nfsd4_setup_inter_ssc()
1285 memcpy(copy->stateid.other, (void *)&s_stid->si_opaque, in nfsd4_setup_inter_ssc()
1308 struct nfsd4_copy *copy, in nfsd4_setup_inter_ssc() argument
1332 struct nfsd4_copy *copy) in nfsd4_setup_intra_ssc() argument
1334 return nfsd4_verify_copy(rqstp, cstate, &copy->cp_src_stateid, in nfsd4_setup_intra_ssc()
1335 &copy->nf_src, &copy->cp_dst_stateid, in nfsd4_setup_intra_ssc()
1336 &copy->nf_dst); in nfsd4_setup_intra_ssc()
1348 struct nfsd4_copy *copy = container_of(cb, struct nfsd4_copy, cp_cb); in nfsd4_cb_offload_release() local
1350 nfs4_put_copy(copy); in nfsd4_cb_offload_release()
1364 static void nfsd4_init_copy_res(struct nfsd4_copy *copy, bool sync) in nfsd4_init_copy_res() argument
1366 copy->cp_res.wr_stable_how = NFS_UNSTABLE; in nfsd4_init_copy_res()
1367 copy->cp_synchronous = sync; in nfsd4_init_copy_res()
1368 gen_boot_verifier(&copy->cp_res.wr_verifier, copy->cp_clp->net); in nfsd4_init_copy_res()
1371 static ssize_t _nfsd_copy_file_range(struct nfsd4_copy *copy) in _nfsd_copy_file_range() argument
1373 struct file *dst = copy->nf_dst->nf_file; in _nfsd_copy_file_range()
1374 struct file *src = copy->nf_src->nf_file; in _nfsd_copy_file_range()
1376 size_t bytes_total = copy->cp_count; in _nfsd_copy_file_range()
1377 u64 src_pos = copy->cp_src_pos; in _nfsd_copy_file_range()
1378 u64 dst_pos = copy->cp_dst_pos; in _nfsd_copy_file_range()
1388 copy->cp_res.wr_bytes_written += bytes_copied; in _nfsd_copy_file_range()
1391 } while (bytes_total > 0 && !copy->cp_synchronous); in _nfsd_copy_file_range()
1395 static __be32 nfsd4_do_copy(struct nfsd4_copy *copy, bool sync) in nfsd4_do_copy() argument
1400 bytes = _nfsd_copy_file_range(copy); in nfsd4_do_copy()
1404 if (bytes < 0 && !copy->cp_res.wr_bytes_written) in nfsd4_do_copy()
1407 nfsd4_init_copy_res(copy, sync); in nfsd4_do_copy()
1411 if (!copy->cp_intra) /* Inter server SSC */ in nfsd4_do_copy()
1412 nfsd4_cleanup_inter_ssc(copy->ss_mnt, copy->nf_src, in nfsd4_do_copy()
1413 copy->nf_dst); in nfsd4_do_copy()
1415 nfsd4_cleanup_intra_ssc(copy->nf_src, copy->nf_dst); in nfsd4_do_copy()
1441 static void cleanup_async_copy(struct nfsd4_copy *copy) in cleanup_async_copy() argument
1443 nfs4_free_copy_state(copy); in cleanup_async_copy()
1444 nfsd_file_put(copy->nf_dst); in cleanup_async_copy()
1445 if (copy->cp_intra) in cleanup_async_copy()
1446 nfsd_file_put(copy->nf_src); in cleanup_async_copy()
1447 spin_lock(&copy->cp_clp->async_lock); in cleanup_async_copy()
1448 list_del(&copy->copies); in cleanup_async_copy()
1449 spin_unlock(&copy->cp_clp->async_lock); in cleanup_async_copy()
1450 nfs4_put_copy(copy); in cleanup_async_copy()
1455 struct nfsd4_copy *copy = (struct nfsd4_copy *)data; in nfsd4_do_async_copy() local
1458 if (!copy->cp_intra) { /* Inter server SSC */ in nfsd4_do_async_copy()
1459 copy->nf_src = kzalloc(sizeof(struct nfsd_file), GFP_KERNEL); in nfsd4_do_async_copy()
1460 if (!copy->nf_src) { in nfsd4_do_async_copy()
1461 copy->nfserr = nfserr_serverfault; in nfsd4_do_async_copy()
1465 copy->nf_src->nf_file = nfs42_ssc_open(copy->ss_mnt, &copy->c_fh, in nfsd4_do_async_copy()
1466 &copy->stateid); in nfsd4_do_async_copy()
1467 if (IS_ERR(copy->nf_src->nf_file)) { in nfsd4_do_async_copy()
1468 copy->nfserr = nfserr_offload_denied; in nfsd4_do_async_copy()
1474 copy->nfserr = nfsd4_do_copy(copy, 0); in nfsd4_do_async_copy()
1480 memcpy(&cb_copy->cp_res, &copy->cp_res, sizeof(copy->cp_res)); in nfsd4_do_async_copy()
1481 cb_copy->cp_clp = copy->cp_clp; in nfsd4_do_async_copy()
1482 cb_copy->nfserr = copy->nfserr; in nfsd4_do_async_copy()
1483 memcpy(&cb_copy->fh, &copy->fh, sizeof(copy->fh)); in nfsd4_do_async_copy()
1488 if (!copy->cp_intra) in nfsd4_do_async_copy()
1489 kfree(copy->nf_src); in nfsd4_do_async_copy()
1490 cleanup_async_copy(copy); in nfsd4_do_async_copy()
1498 struct nfsd4_copy *copy = &u->copy; in nfsd4_copy() local
1502 if (!copy->cp_intra) { /* Inter server SSC */ in nfsd4_copy()
1503 if (!inter_copy_offload_enable || copy->cp_synchronous) { in nfsd4_copy()
1507 status = nfsd4_setup_inter_ssc(rqstp, cstate, copy, in nfsd4_copy()
1508 &copy->ss_mnt); in nfsd4_copy()
1512 status = nfsd4_setup_intra_ssc(rqstp, cstate, copy); in nfsd4_copy()
1517 copy->cp_clp = cstate->clp; in nfsd4_copy()
1518 memcpy(&copy->fh, &cstate->current_fh.fh_handle, in nfsd4_copy()
1520 if (!copy->cp_synchronous) { in nfsd4_copy()
1527 if (!nfs4_init_copy_state(nn, copy)) in nfsd4_copy()
1530 memcpy(&copy->cp_res.cb_stateid, &copy->cp_stateid.stid, in nfsd4_copy()
1531 sizeof(copy->cp_res.cb_stateid)); in nfsd4_copy()
1532 dup_copy_fields(copy, async_copy); in nfsd4_copy()
1544 status = nfsd4_do_copy(copy, 1); in nfsd4_copy()
1562 struct nfsd4_copy *copy; in find_async_copy() local
1565 list_for_each_entry(copy, &clp->async_copies, copies) { in find_async_copy()
1566 if (memcmp(&copy->cp_stateid.stid, stateid, NFS4_STATEID_SIZE)) in find_async_copy()
1568 refcount_inc(&copy->refcount); in find_async_copy()
1570 return copy; in find_async_copy()
1582 struct nfsd4_copy *copy; in nfsd4_offload_cancel() local
1585 copy = find_async_copy(clp, &os->stateid); in nfsd4_offload_cancel()
1586 if (!copy) { in nfsd4_offload_cancel()
1591 nfsd4_stop_copy(copy); in nfsd4_offload_cancel()
1669 struct nfsd4_copy *copy; in nfsd4_offload_status() local
1672 copy = find_async_copy(clp, &os->stateid); in nfsd4_offload_status()
1673 if (copy) { in nfsd4_offload_status()
1674 os->count = copy->cp_res.wr_bytes_written; in nfsd4_offload_status()
1675 nfs4_put_copy(copy); in nfsd4_offload_status()
2280 struct nfsd4_copy *copy; in check_if_stalefh_allowed() local
2296 copy = (struct nfsd4_copy *)&op->u; in check_if_stalefh_allowed()
2302 if (!copy->cp_intra) in check_if_stalefh_allowed()