Lines Matching +full:triple +full:- +full:channel
1 // SPDX-License-Identifier: GPL-2.0
36 res->status = htonl(NFS4ERR_OP_NOT_IN_SESSION);
37 if (!cps->clp) /* Always set for v4.0. Set in cb_sequence for v4.1 */
40 memset(res->bitmap, 0, sizeof(res->bitmap));
41 res->status = htonl(NFS4ERR_BADHANDLE);
44 rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR));
46 inode = nfs_delegation_find_inode(cps->clp, &args->fh);
48 if (inode == ERR_PTR(-EAGAIN))
49 res->status = htonl(NFS4ERR_DELAY);
50 trace_nfs4_cb_getattr(cps->clp, &args->fh, NULL,
51 -ntohl(res->status));
56 if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0)
58 res->size = i_size_read(inode);
59 res->change_attr = delegation->change_attr;
61 res->change_attr++;
62 res->atime = inode_get_atime(inode);
63 res->ctime = inode_get_ctime(inode);
64 res->mtime = inode_get_mtime(inode);
65 res->bitmap[0] = (FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE) &
66 args->bitmap[0];
67 res->bitmap[1] = (FATTR4_WORD1_TIME_ACCESS |
69 FATTR4_WORD1_TIME_MODIFY) & args->bitmap[1];
70 res->bitmap[2] = (FATTR4_WORD2_TIME_DELEG_ACCESS |
71 FATTR4_WORD2_TIME_DELEG_MODIFY) & args->bitmap[2];
72 res->status = 0;
75 trace_nfs4_cb_getattr(cps->clp, &args->fh, inode, -ntohl(res->status));
78 dprintk("%s: exit with status = %d\n", __func__, ntohl(res->status));
79 return res->status;
90 if (!cps->clp) /* Always set for v4.0. Set in cb_sequence for v4.1 */
94 rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR));
97 inode = nfs_delegation_find_inode(cps->clp, &args->fh);
99 if (inode == ERR_PTR(-EAGAIN))
101 trace_nfs4_cb_recall(cps->clp, &args->fh, NULL,
102 &args->stateid, -ntohl(res));
106 switch (nfs_async_inode_return_delegation(inode, &args->stateid)) {
110 case -ENOENT:
116 trace_nfs4_cb_recall(cps->clp, &args->fh, inode,
117 &args->stateid, -ntohl(res));
140 list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
141 list_for_each_entry_rcu(lo, &server->layouts, plh_layouts) {
144 if (!nfs4_stateid_match_other(stateid, &lo->plh_stateid))
146 if (nfs_sb_active(server->super))
147 inode = igrab(lo->plh_inode);
149 inode = ERR_PTR(-EAGAIN);
153 nfs_sb_deactive(server->super);
154 return ERR_PTR(-EAGAIN);
158 return ERR_PTR(-ENOENT);
176 list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
177 list_for_each_entry_rcu(lo, &server->layouts, plh_layouts) {
178 nfsi = NFS_I(lo->plh_inode);
179 if (nfs_compare_fh(fh, &nfsi->fh))
181 if (nfsi->layout != lo)
183 if (nfs_sb_active(server->super))
184 inode = igrab(lo->plh_inode);
186 inode = ERR_PTR(-EAGAIN);
190 nfs_sb_deactive(server->super);
191 return ERR_PTR(-EAGAIN);
195 return ERR_PTR(-ENOENT);
205 if (inode == ERR_PTR(-ENOENT))
224 if (!nfs4_stateid_match_other(&lo->plh_stateid, new))
227 newseq = be32_to_cpu(new->seqid);
229 if (test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags))
238 oldseq = be32_to_cpu(lo->plh_stateid.seqid);
239 if (newseq > oldseq + 1 && !cps->referring_calls)
258 ino = nfs_layout_find_inode(clp, &args->cbl_fh, &args->cbl_stateid);
260 if (ino == ERR_PTR(-EAGAIN))
268 spin_lock(&ino->i_lock);
269 lo = NFS_I(ino)->layout;
271 spin_unlock(&ino->i_lock);
275 rv = pnfs_check_callback_stateid(lo, &args->cbl_stateid, cps);
282 if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) {
287 pnfs_set_layout_stateid(lo, &args->cbl_stateid, NULL, true);
289 &args->cbl_range,
290 be32_to_cpu(args->cbl_stateid.seqid))) {
292 case -EBUSY:
296 case -ENOENT:
297 set_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags);
301 if (NFS_SERVER(ino)->pnfs_curr_ld->return_range) {
302 NFS_SERVER(ino)->pnfs_curr_ld->return_range(lo,
303 &args->cbl_range);
307 spin_unlock(&ino->i_lock);
315 trace_nfs4_cb_layoutrecall_file(clp, &args->cbl_fh, ino,
316 &args->cbl_stateid, -rv);
325 if (args->cbl_recall_type == RETURN_FSID)
326 stat = pnfs_layout_destroy_byfsid(clp, &args->cbl_fsid,
339 if (args->cbl_recall_type == RETURN_FILE)
350 if (cps->clp)
351 res = do_callback_layoutrecall(cps->clp, args, cps);
375 if (!cps->clp) {
380 for (i = 0; i < args->ndevs; i++) {
381 struct cb_devicenotifyitem *dev = &args->devs[i];
383 if (!ld || ld->id != dev->cbd_layout_type) {
385 ld = pnfs_find_layoutdriver(dev->cbd_layout_type);
389 nfs4_delete_deviceid(ld, cps->clp, &dev->cbd_dev_id);
393 kfree(args->devs);
403 * back channel ca_maxresponsesize_cached to zero. This is OK for now
417 if (args->csa_slotid > tbl->server_highest_slotid)
421 if (args->csa_sequenceid == slot->seq_nr) {
423 if (nfs4_test_locked_slot(tbl, slot->slot_nr))
428 if (args->csa_cachethis == 0)
439 if (args->csa_sequenceid != slot->seq_nr + 1)
450 * For each referring call triple, check the session's slot table for
473 session = clp->cl_session;
474 tbl = &session->fc_slot_table;
478 if (memcmp(session->sess_id.data,
479 rclist->rcl_sessionid.data,
483 for (j = 0; j < rclist->rcl_nrefcalls; j++) {
484 ref = &rclist->rcl_refcalls[j];
486 status = nfs4_slot_wait_on_seqid(tbl, ref->rc_slotid,
487 ref->rc_sequenceid, HZ >> 1) < 0;
511 clp = nfs4_find_client_sessionid(cps->net, args->csa_addr,
512 &args->csa_sessionid, cps->minorversion);
516 if (!(clp->cl_session->flags & SESSION4_BACK_CHAN))
519 tbl = &clp->cl_session->bc_slot_table;
522 memcpy(&res->csr_sessionid, &args->csa_sessionid,
523 sizeof(res->csr_sessionid));
524 res->csr_sequenceid = args->csa_sequenceid;
525 res->csr_slotid = args->csa_slotid;
527 spin_lock(&tbl->slot_tbl_lock);
529 if (test_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state)) {
534 if (test_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state))
540 slot = nfs4_lookup_slot(tbl, args->csa_slotid);
544 res->csr_highestslotid = tbl->server_highest_slotid;
545 res->csr_target_highestslotid = tbl->target_highest_slotid;
554 cps->slot = slot;
557 if (args->csa_cachethis != 0) {
567 ret = referring_call_exists(clp, args->csa_nrclists, args->csa_rclists,
568 &tbl->slot_tbl_lock);
573 cps->referring_calls = ret;
580 slot->seq_nr = args->csa_sequenceid;
582 spin_unlock(&tbl->slot_tbl_lock);
585 cps->clp = clp; /* put in nfs4_callback_compound */
586 for (i = 0; i < args->csa_nrclists; i++)
587 kfree(args->csa_rclists[i].rcl_refcalls);
588 kfree(args->csa_rclists);
591 cps->drc_status = status;
594 res->csr_status = status;
615 if (!cps->clp) /* set in cb_sequence */
619 rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR));
622 if (!validate_bitmap_values(args->craa_type_mask))
626 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_RDATA_DLG))
628 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_WDATA_DLG))
631 nfs_expire_unused_delegation_types(cps->clp, flags);
633 if (args->craa_type_mask & BIT(RCA4_TYPE_MASK_FILE_LAYOUT))
634 pnfs_recall_all_layouts(cps->clp, cps);
636 if (args->craa_type_mask & BIT(PNFS_FF_RCA4_TYPE_MASK_READ)) {
637 set_bit(NFS4CLNT_RECALL_ANY_LAYOUT_READ, &cps->clp->cl_state);
640 if (args->craa_type_mask & BIT(PNFS_FF_RCA4_TYPE_MASK_RW)) {
641 set_bit(NFS4CLNT_RECALL_ANY_LAYOUT_RW, &cps->clp->cl_state);
645 nfs4_schedule_state_manager(cps->clp);
652 /* Reduce the fore channel's max_slots to the target value */
661 if (!cps->clp) /* set in cb_sequence */
665 rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR),
666 args->crsa_target_highest_slotid);
668 fc_tbl = &cps->clp->cl_session->fc_slot_table;
672 nfs41_set_target_slotid(fc_tbl, args->crsa_target_highest_slotid);
673 nfs41_notify_server(cps->clp);
684 if (!cps->clp) /* set in cb_sequence */
688 rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR));
691 if (args->cbnl_valid)
692 __wake_up(&cps->clp->cl_lock_waitq, TASK_NORMAL, 0, args);
701 cp_state->count = args->wr_count;
702 cp_state->error = args->error;
703 if (!args->error) {
704 cp_state->verf.committed = args->wr_writeverf.committed;
705 memcpy(&cp_state->verf.verifier.data[0],
706 &args->wr_writeverf.verifier.data[0],
723 spin_lock(&cps->clp->cl_lock);
725 list_for_each_entry_rcu(server, &cps->clp->cl_superblocks,
727 list_for_each_entry(tmp_copy, &server->ss_copies, copies) {
728 if (memcmp(args->coa_stateid.other,
729 tmp_copy->stateid.other,
730 sizeof(args->coa_stateid.other)))
733 complete(&tmp_copy->completion);
741 memcpy(©->stateid, &args->coa_stateid, NFS4_STATEID_SIZE);
743 list_add_tail(©->copies, &cps->clp->pending_cb_stateids);
746 spin_unlock(&cps->clp->cl_lock);
748 trace_nfs4_cb_offload(&args->coa_fh, &args->coa_stateid,
749 args->wr_count, args->error,
750 args->wr_writeverf.committed);