Lines Matching +full:vp +full:- +full:p
1 // SPDX-License-Identifier: GPL-2.0-or-later
24 fid->vid = ntohl(*bp++); in xdr_decode_AFSFid()
25 fid->vnode = ntohl(*bp++); in xdr_decode_AFSFid()
26 fid->unique = ntohl(*bp++); in xdr_decode_AFSFid()
58 struct afs_file_status *status = &scb->status; in xdr_decode_AFSFetchStatus()
59 bool inline_error = (call->operation_ID == afs_FS_InlineBulkStatus); in xdr_decode_AFSFetchStatus()
63 abort_code = ntohl(xdr->abort_code); in xdr_decode_AFSFetchStatus()
65 if (xdr->if_version != htonl(AFS_FSTATUS_VERSION)) { in xdr_decode_AFSFetchStatus()
66 if (xdr->if_version == htonl(0) && in xdr_decode_AFSFetchStatus()
73 status->abort_code = abort_code; in xdr_decode_AFSFetchStatus()
74 scb->have_error = true; in xdr_decode_AFSFetchStatus()
78 pr_warn("Unknown AFSFetchStatus version %u\n", ntohl(xdr->if_version)); in xdr_decode_AFSFetchStatus()
83 status->abort_code = abort_code; in xdr_decode_AFSFetchStatus()
84 scb->have_error = true; in xdr_decode_AFSFetchStatus()
88 type = ntohl(xdr->type); in xdr_decode_AFSFetchStatus()
93 status->type = type; in xdr_decode_AFSFetchStatus()
99 status->nlink = ntohl(xdr->nlink); in xdr_decode_AFSFetchStatus()
100 status->author = ntohl(xdr->author); in xdr_decode_AFSFetchStatus()
101 status->owner = ntohl(xdr->owner); in xdr_decode_AFSFetchStatus()
102 status->caller_access = ntohl(xdr->caller_access); /* Ticket dependent */ in xdr_decode_AFSFetchStatus()
103 status->anon_access = ntohl(xdr->anon_access); in xdr_decode_AFSFetchStatus()
104 status->mode = ntohl(xdr->mode) & S_IALLUGO; in xdr_decode_AFSFetchStatus()
105 status->group = ntohl(xdr->group); in xdr_decode_AFSFetchStatus()
106 status->lock_count = ntohl(xdr->lock_count); in xdr_decode_AFSFetchStatus()
108 status->mtime_client.tv_sec = ntohl(xdr->mtime_client); in xdr_decode_AFSFetchStatus()
109 status->mtime_client.tv_nsec = 0; in xdr_decode_AFSFetchStatus()
110 status->mtime_server.tv_sec = ntohl(xdr->mtime_server); in xdr_decode_AFSFetchStatus()
111 status->mtime_server.tv_nsec = 0; in xdr_decode_AFSFetchStatus()
113 size = (u64)ntohl(xdr->size_lo); in xdr_decode_AFSFetchStatus()
114 size |= (u64)ntohl(xdr->size_hi) << 32; in xdr_decode_AFSFetchStatus()
115 status->size = size; in xdr_decode_AFSFetchStatus()
117 data_version = (u64)ntohl(xdr->data_version_lo); in xdr_decode_AFSFetchStatus()
118 data_version |= (u64)ntohl(xdr->data_version_hi) << 32; in xdr_decode_AFSFetchStatus()
119 status->data_version = data_version; in xdr_decode_AFSFetchStatus()
120 scb->have_status = true; in xdr_decode_AFSFetchStatus()
133 return ktime_divns(call->issue_time, NSEC_PER_SEC) + expiry; in xdr_decode_expiry()
140 struct afs_callback *cb = &scb->callback; in xdr_decode_AFSCallBack()
144 cb->expires_at = xdr_decode_expiry(call, ntohl(*bp++)); in xdr_decode_AFSCallBack()
146 scb->have_cb = true; in xdr_decode_AFSCallBack()
168 volsync->creation = creation; in xdr_decode_AFSVolSync()
180 if (attr->ia_valid & ATTR_MTIME) { in xdr_encode_AFS_StoreStatus()
182 mtime = attr->ia_mtime.tv_sec; in xdr_encode_AFS_StoreStatus()
185 if (attr->ia_valid & ATTR_UID) { in xdr_encode_AFS_StoreStatus()
187 owner = from_kuid(&init_user_ns, attr->ia_uid); in xdr_encode_AFS_StoreStatus()
190 if (attr->ia_valid & ATTR_GID) { in xdr_encode_AFS_StoreStatus()
192 group = from_kgid(&init_user_ns, attr->ia_gid); in xdr_encode_AFS_StoreStatus()
195 if (attr->ia_valid & ATTR_MODE) { in xdr_encode_AFS_StoreStatus()
197 mode = attr->ia_mode & S_IALLUGO; in xdr_encode_AFS_StoreStatus()
217 vs->vid = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
218 vs->parent_id = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
219 vs->online = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
220 vs->in_service = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
221 vs->blessed = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
222 vs->needs_salvage = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
223 vs->type = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
224 vs->min_quota = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
225 vs->max_quota = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
226 vs->blocks_in_use = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
227 vs->part_blocks_avail = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
228 vs->part_max_blocks = ntohl(*bp++); in xdr_decode_AFSFetchVolumeStatus()
229 vs->vol_copy_date = 0; in xdr_decode_AFSFetchVolumeStatus()
230 vs->vol_backup_date = 0; in xdr_decode_AFSFetchVolumeStatus()
239 struct afs_operation *op = call->op; in afs_deliver_fs_fetch_status()
240 struct afs_vnode_param *vp = &op->file[op->fetch_status.which]; in afs_deliver_fs_fetch_status() local
249 bp = call->buffer; in afs_deliver_fs_fetch_status()
250 xdr_decode_AFSFetchStatus(&bp, call, &vp->scb); in afs_deliver_fs_fetch_status()
251 xdr_decode_AFSCallBack(&bp, call, &vp->scb); in afs_deliver_fs_fetch_status()
252 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_fetch_status()
273 struct afs_vnode_param *vp = &op->file[op->fetch_status.which]; in afs_fs_fetch_status() local
278 key_serial(op->key), vp->fid.vid, vp->fid.vnode); in afs_fs_fetch_status()
280 call = afs_alloc_flat_call(op->net, &afs_RXFSFetchStatus, in afs_fs_fetch_status()
286 bp = call->request; in afs_fs_fetch_status()
288 bp[1] = htonl(vp->fid.vid); in afs_fs_fetch_status()
289 bp[2] = htonl(vp->fid.vnode); in afs_fs_fetch_status()
290 bp[3] = htonl(vp->fid.unique); in afs_fs_fetch_status()
292 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_fetch_status()
301 struct afs_operation *op = call->op; in afs_deliver_fs_fetch_data()
302 struct afs_vnode_param *vp = &op->file[0]; in afs_deliver_fs_fetch_data() local
303 struct afs_read *req = op->fetch.req; in afs_deliver_fs_fetch_data()
309 call->unmarshall, iov_iter_count(call->iter), req->actual_len); in afs_deliver_fs_fetch_data()
311 switch (call->unmarshall) { in afs_deliver_fs_fetch_data()
313 req->actual_len = 0; in afs_deliver_fs_fetch_data()
314 req->index = 0; in afs_deliver_fs_fetch_data()
315 req->offset = req->pos & (PAGE_SIZE - 1); in afs_deliver_fs_fetch_data()
316 call->unmarshall++; in afs_deliver_fs_fetch_data()
317 if (call->operation_ID == FSFETCHDATA64) { in afs_deliver_fs_fetch_data()
320 call->tmp_u = htonl(0); in afs_deliver_fs_fetch_data()
332 req->actual_len = be64_to_cpu(call->tmp64); in afs_deliver_fs_fetch_data()
333 _debug("DATA length: %llu", req->actual_len); in afs_deliver_fs_fetch_data()
334 req->remain = min(req->len, req->actual_len); in afs_deliver_fs_fetch_data()
335 if (req->remain == 0) in afs_deliver_fs_fetch_data()
338 call->unmarshall++; in afs_deliver_fs_fetch_data()
341 ASSERTCMP(req->index, <, req->nr_pages); in afs_deliver_fs_fetch_data()
342 if (req->remain > PAGE_SIZE - req->offset) in afs_deliver_fs_fetch_data()
343 size = PAGE_SIZE - req->offset; in afs_deliver_fs_fetch_data()
345 size = req->remain; in afs_deliver_fs_fetch_data()
346 call->bvec[0].bv_len = size; in afs_deliver_fs_fetch_data()
347 call->bvec[0].bv_offset = req->offset; in afs_deliver_fs_fetch_data()
348 call->bvec[0].bv_page = req->pages[req->index]; in afs_deliver_fs_fetch_data()
349 iov_iter_bvec(&call->def_iter, READ, call->bvec, 1, size); in afs_deliver_fs_fetch_data()
356 iov_iter_count(call->iter), req->remain); in afs_deliver_fs_fetch_data()
361 req->remain -= call->bvec[0].bv_len; in afs_deliver_fs_fetch_data()
362 req->offset += call->bvec[0].bv_len; in afs_deliver_fs_fetch_data()
363 ASSERTCMP(req->offset, <=, PAGE_SIZE); in afs_deliver_fs_fetch_data()
364 if (req->offset == PAGE_SIZE) { in afs_deliver_fs_fetch_data()
365 req->offset = 0; in afs_deliver_fs_fetch_data()
366 req->index++; in afs_deliver_fs_fetch_data()
367 if (req->remain > 0) in afs_deliver_fs_fetch_data()
371 ASSERTCMP(req->remain, ==, 0); in afs_deliver_fs_fetch_data()
372 if (req->actual_len <= req->len) in afs_deliver_fs_fetch_data()
376 afs_extract_discard(call, req->actual_len - req->len); in afs_deliver_fs_fetch_data()
377 call->unmarshall = 3; in afs_deliver_fs_fetch_data()
382 iov_iter_count(call->iter), req->actual_len - req->len); in afs_deliver_fs_fetch_data()
389 call->unmarshall = 4; in afs_deliver_fs_fetch_data()
399 bp = call->buffer; in afs_deliver_fs_fetch_data()
400 xdr_decode_AFSFetchStatus(&bp, call, &vp->scb); in afs_deliver_fs_fetch_data()
401 xdr_decode_AFSCallBack(&bp, call, &vp->scb); in afs_deliver_fs_fetch_data()
402 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_fetch_data()
404 req->data_version = vp->scb.status.data_version; in afs_deliver_fs_fetch_data()
405 req->file_size = vp->scb.status.size; in afs_deliver_fs_fetch_data()
407 call->unmarshall++; in afs_deliver_fs_fetch_data()
413 for (; req->index < req->nr_pages; req->index++) { in afs_deliver_fs_fetch_data()
414 if (req->offset < PAGE_SIZE) in afs_deliver_fs_fetch_data()
415 zero_user_segment(req->pages[req->index], in afs_deliver_fs_fetch_data()
416 req->offset, PAGE_SIZE); in afs_deliver_fs_fetch_data()
417 req->offset = 0; in afs_deliver_fs_fetch_data()
420 if (req->page_done) in afs_deliver_fs_fetch_data()
421 for (req->index = 0; req->index < req->nr_pages; req->index++) in afs_deliver_fs_fetch_data()
422 req->page_done(req); in afs_deliver_fs_fetch_data()
450 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_fetch_data64() local
451 struct afs_read *req = op->fetch.req; in afs_fs_fetch_data64()
457 call = afs_alloc_flat_call(op->net, &afs_RXFSFetchData64, 32, (21 + 3 + 6) * 4); in afs_fs_fetch_data64()
462 bp = call->request; in afs_fs_fetch_data64()
464 bp[1] = htonl(vp->fid.vid); in afs_fs_fetch_data64()
465 bp[2] = htonl(vp->fid.vnode); in afs_fs_fetch_data64()
466 bp[3] = htonl(vp->fid.unique); in afs_fs_fetch_data64()
467 bp[4] = htonl(upper_32_bits(req->pos)); in afs_fs_fetch_data64()
468 bp[5] = htonl(lower_32_bits(req->pos)); in afs_fs_fetch_data64()
470 bp[7] = htonl(lower_32_bits(req->len)); in afs_fs_fetch_data64()
472 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_fetch_data64()
481 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_fetch_data() local
483 struct afs_read *req = op->fetch.req; in afs_fs_fetch_data()
486 if (upper_32_bits(req->pos) || in afs_fs_fetch_data()
487 upper_32_bits(req->len) || in afs_fs_fetch_data()
488 upper_32_bits(req->pos + req->len)) in afs_fs_fetch_data()
493 call = afs_alloc_flat_call(op->net, &afs_RXFSFetchData, 24, (21 + 3 + 6) * 4); in afs_fs_fetch_data()
498 bp = call->request; in afs_fs_fetch_data()
500 bp[1] = htonl(vp->fid.vid); in afs_fs_fetch_data()
501 bp[2] = htonl(vp->fid.vnode); in afs_fs_fetch_data()
502 bp[3] = htonl(vp->fid.unique); in afs_fs_fetch_data()
503 bp[4] = htonl(lower_32_bits(req->pos)); in afs_fs_fetch_data()
504 bp[5] = htonl(lower_32_bits(req->len)); in afs_fs_fetch_data()
506 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_fetch_data()
515 struct afs_operation *op = call->op; in afs_deliver_fs_create_vnode()
516 struct afs_vnode_param *dvp = &op->file[0]; in afs_deliver_fs_create_vnode()
517 struct afs_vnode_param *vp = &op->file[1]; in afs_deliver_fs_create_vnode() local
526 bp = call->buffer; in afs_deliver_fs_create_vnode()
527 xdr_decode_AFSFid(&bp, &op->file[1].fid); in afs_deliver_fs_create_vnode()
528 xdr_decode_AFSFetchStatus(&bp, call, &vp->scb); in afs_deliver_fs_create_vnode()
529 xdr_decode_AFSFetchStatus(&bp, call, &dvp->scb); in afs_deliver_fs_create_vnode()
530 xdr_decode_AFSCallBack(&bp, call, &vp->scb); in afs_deliver_fs_create_vnode()
531 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_create_vnode()
552 const struct qstr *name = &op->dentry->d_name; in afs_fs_create_file()
553 struct afs_vnode_param *dvp = &op->file[0]; in afs_fs_create_file()
560 namesz = name->len; in afs_fs_create_file()
561 padsz = (4 - (namesz & 3)) & 3; in afs_fs_create_file()
564 call = afs_alloc_flat_call(op->net, &afs_RXFSCreateFile, in afs_fs_create_file()
570 bp = call->request; in afs_fs_create_file()
572 *bp++ = htonl(dvp->fid.vid); in afs_fs_create_file()
573 *bp++ = htonl(dvp->fid.vnode); in afs_fs_create_file()
574 *bp++ = htonl(dvp->fid.unique); in afs_fs_create_file()
576 memcpy(bp, name->name, namesz); in afs_fs_create_file()
583 *bp++ = htonl(op->mtime.tv_sec); /* mtime */ in afs_fs_create_file()
586 *bp++ = htonl(op->create.mode & S_IALLUGO); /* unix mode */ in afs_fs_create_file()
589 trace_afs_make_fs_call1(call, &dvp->fid, name); in afs_fs_create_file()
605 const struct qstr *name = &op->dentry->d_name; in afs_fs_make_dir()
606 struct afs_vnode_param *dvp = &op->file[0]; in afs_fs_make_dir()
613 namesz = name->len; in afs_fs_make_dir()
614 padsz = (4 - (namesz & 3)) & 3; in afs_fs_make_dir()
617 call = afs_alloc_flat_call(op->net, &afs_RXFSMakeDir, in afs_fs_make_dir()
623 bp = call->request; in afs_fs_make_dir()
625 *bp++ = htonl(dvp->fid.vid); in afs_fs_make_dir()
626 *bp++ = htonl(dvp->fid.vnode); in afs_fs_make_dir()
627 *bp++ = htonl(dvp->fid.unique); in afs_fs_make_dir()
629 memcpy(bp, name->name, namesz); in afs_fs_make_dir()
636 *bp++ = htonl(op->mtime.tv_sec); /* mtime */ in afs_fs_make_dir()
639 *bp++ = htonl(op->create.mode & S_IALLUGO); /* unix mode */ in afs_fs_make_dir()
642 trace_afs_make_fs_call1(call, &dvp->fid, name); in afs_fs_make_dir()
651 struct afs_operation *op = call->op; in afs_deliver_fs_file_status_and_vol()
652 struct afs_vnode_param *vp = &op->file[0]; in afs_deliver_fs_file_status_and_vol() local
661 bp = call->buffer; in afs_deliver_fs_file_status_and_vol()
662 xdr_decode_AFSFetchStatus(&bp, call, &vp->scb); in afs_deliver_fs_file_status_and_vol()
663 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_file_status_and_vol()
684 const struct qstr *name = &op->dentry->d_name; in afs_fs_remove_file()
685 struct afs_vnode_param *dvp = &op->file[0]; in afs_fs_remove_file()
692 namesz = name->len; in afs_fs_remove_file()
693 padsz = (4 - (namesz & 3)) & 3; in afs_fs_remove_file()
696 call = afs_alloc_flat_call(op->net, &afs_RXFSRemoveFile, in afs_fs_remove_file()
702 bp = call->request; in afs_fs_remove_file()
704 *bp++ = htonl(dvp->fid.vid); in afs_fs_remove_file()
705 *bp++ = htonl(dvp->fid.vnode); in afs_fs_remove_file()
706 *bp++ = htonl(dvp->fid.unique); in afs_fs_remove_file()
708 memcpy(bp, name->name, namesz); in afs_fs_remove_file()
715 trace_afs_make_fs_call1(call, &dvp->fid, name); in afs_fs_remove_file()
731 const struct qstr *name = &op->dentry->d_name; in afs_fs_remove_dir()
732 struct afs_vnode_param *dvp = &op->file[0]; in afs_fs_remove_dir()
739 namesz = name->len; in afs_fs_remove_dir()
740 padsz = (4 - (namesz & 3)) & 3; in afs_fs_remove_dir()
743 call = afs_alloc_flat_call(op->net, &afs_RXFSRemoveDir, in afs_fs_remove_dir()
749 bp = call->request; in afs_fs_remove_dir()
751 *bp++ = htonl(dvp->fid.vid); in afs_fs_remove_dir()
752 *bp++ = htonl(dvp->fid.vnode); in afs_fs_remove_dir()
753 *bp++ = htonl(dvp->fid.unique); in afs_fs_remove_dir()
755 memcpy(bp, name->name, namesz); in afs_fs_remove_dir()
762 trace_afs_make_fs_call1(call, &dvp->fid, name); in afs_fs_remove_dir()
771 struct afs_operation *op = call->op; in afs_deliver_fs_link()
772 struct afs_vnode_param *dvp = &op->file[0]; in afs_deliver_fs_link()
773 struct afs_vnode_param *vp = &op->file[1]; in afs_deliver_fs_link() local
777 _enter("{%u}", call->unmarshall); in afs_deliver_fs_link()
784 bp = call->buffer; in afs_deliver_fs_link()
785 xdr_decode_AFSFetchStatus(&bp, call, &vp->scb); in afs_deliver_fs_link()
786 xdr_decode_AFSFetchStatus(&bp, call, &dvp->scb); in afs_deliver_fs_link()
787 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_link()
808 const struct qstr *name = &op->dentry->d_name; in afs_fs_link()
809 struct afs_vnode_param *dvp = &op->file[0]; in afs_fs_link()
810 struct afs_vnode_param *vp = &op->file[1]; in afs_fs_link() local
817 namesz = name->len; in afs_fs_link()
818 padsz = (4 - (namesz & 3)) & 3; in afs_fs_link()
821 call = afs_alloc_flat_call(op->net, &afs_RXFSLink, reqsz, (21 + 21 + 6) * 4); in afs_fs_link()
826 bp = call->request; in afs_fs_link()
828 *bp++ = htonl(dvp->fid.vid); in afs_fs_link()
829 *bp++ = htonl(dvp->fid.vnode); in afs_fs_link()
830 *bp++ = htonl(dvp->fid.unique); in afs_fs_link()
832 memcpy(bp, name->name, namesz); in afs_fs_link()
838 *bp++ = htonl(vp->fid.vid); in afs_fs_link()
839 *bp++ = htonl(vp->fid.vnode); in afs_fs_link()
840 *bp++ = htonl(vp->fid.unique); in afs_fs_link()
842 trace_afs_make_fs_call1(call, &vp->fid, name); in afs_fs_link()
851 struct afs_operation *op = call->op; in afs_deliver_fs_symlink()
852 struct afs_vnode_param *dvp = &op->file[0]; in afs_deliver_fs_symlink()
853 struct afs_vnode_param *vp = &op->file[1]; in afs_deliver_fs_symlink() local
857 _enter("{%u}", call->unmarshall); in afs_deliver_fs_symlink()
864 bp = call->buffer; in afs_deliver_fs_symlink()
865 xdr_decode_AFSFid(&bp, &vp->fid); in afs_deliver_fs_symlink()
866 xdr_decode_AFSFetchStatus(&bp, call, &vp->scb); in afs_deliver_fs_symlink()
867 xdr_decode_AFSFetchStatus(&bp, call, &dvp->scb); in afs_deliver_fs_symlink()
868 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_symlink()
889 const struct qstr *name = &op->dentry->d_name; in afs_fs_symlink()
890 struct afs_vnode_param *dvp = &op->file[0]; in afs_fs_symlink()
897 namesz = name->len; in afs_fs_symlink()
898 padsz = (4 - (namesz & 3)) & 3; in afs_fs_symlink()
900 c_namesz = strlen(op->create.symlink); in afs_fs_symlink()
901 c_padsz = (4 - (c_namesz & 3)) & 3; in afs_fs_symlink()
905 call = afs_alloc_flat_call(op->net, &afs_RXFSSymlink, reqsz, in afs_fs_symlink()
911 bp = call->request; in afs_fs_symlink()
913 *bp++ = htonl(dvp->fid.vid); in afs_fs_symlink()
914 *bp++ = htonl(dvp->fid.vnode); in afs_fs_symlink()
915 *bp++ = htonl(dvp->fid.unique); in afs_fs_symlink()
917 memcpy(bp, name->name, namesz); in afs_fs_symlink()
924 memcpy(bp, op->create.symlink, c_namesz); in afs_fs_symlink()
931 *bp++ = htonl(op->mtime.tv_sec); /* mtime */ in afs_fs_symlink()
937 trace_afs_make_fs_call1(call, &dvp->fid, name); in afs_fs_symlink()
946 struct afs_operation *op = call->op; in afs_deliver_fs_rename()
947 struct afs_vnode_param *orig_dvp = &op->file[0]; in afs_deliver_fs_rename()
948 struct afs_vnode_param *new_dvp = &op->file[1]; in afs_deliver_fs_rename()
956 bp = call->buffer; in afs_deliver_fs_rename()
960 xdr_decode_AFSFetchStatus(&bp, call, &orig_dvp->scb); in afs_deliver_fs_rename()
961 xdr_decode_AFSFetchStatus(&bp, call, &new_dvp->scb); in afs_deliver_fs_rename()
962 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_rename()
983 struct afs_vnode_param *orig_dvp = &op->file[0]; in afs_fs_rename()
984 struct afs_vnode_param *new_dvp = &op->file[1]; in afs_fs_rename()
985 const struct qstr *orig_name = &op->dentry->d_name; in afs_fs_rename()
986 const struct qstr *new_name = &op->dentry_2->d_name; in afs_fs_rename()
993 o_namesz = orig_name->len; in afs_fs_rename()
994 o_padsz = (4 - (o_namesz & 3)) & 3; in afs_fs_rename()
996 n_namesz = new_name->len; in afs_fs_rename()
997 n_padsz = (4 - (n_namesz & 3)) & 3; in afs_fs_rename()
1004 call = afs_alloc_flat_call(op->net, &afs_RXFSRename, reqsz, (21 + 21 + 6) * 4); in afs_fs_rename()
1009 bp = call->request; in afs_fs_rename()
1011 *bp++ = htonl(orig_dvp->fid.vid); in afs_fs_rename()
1012 *bp++ = htonl(orig_dvp->fid.vnode); in afs_fs_rename()
1013 *bp++ = htonl(orig_dvp->fid.unique); in afs_fs_rename()
1015 memcpy(bp, orig_name->name, o_namesz); in afs_fs_rename()
1022 *bp++ = htonl(new_dvp->fid.vid); in afs_fs_rename()
1023 *bp++ = htonl(new_dvp->fid.vnode); in afs_fs_rename()
1024 *bp++ = htonl(new_dvp->fid.unique); in afs_fs_rename()
1026 memcpy(bp, new_name->name, n_namesz); in afs_fs_rename()
1033 trace_afs_make_fs_call2(call, &orig_dvp->fid, orig_name, new_name); in afs_fs_rename()
1042 struct afs_operation *op = call->op; in afs_deliver_fs_store_data()
1043 struct afs_vnode_param *vp = &op->file[0]; in afs_deliver_fs_store_data() local
1054 bp = call->buffer; in afs_deliver_fs_store_data()
1055 xdr_decode_AFSFetchStatus(&bp, call, &vp->scb); in afs_deliver_fs_store_data()
1056 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_store_data()
1085 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_store_data64() local
1090 key_serial(op->key), vp->fid.vid, vp->fid.vnode); in afs_fs_store_data64()
1092 call = afs_alloc_flat_call(op->net, &afs_RXFSStoreData64, in afs_fs_store_data64()
1098 call->send_pages = true; in afs_fs_store_data64()
1101 bp = call->request; in afs_fs_store_data64()
1103 *bp++ = htonl(vp->fid.vid); in afs_fs_store_data64()
1104 *bp++ = htonl(vp->fid.vnode); in afs_fs_store_data64()
1105 *bp++ = htonl(vp->fid.unique); in afs_fs_store_data64()
1108 *bp++ = htonl(op->mtime.tv_sec); /* mtime */ in afs_fs_store_data64()
1121 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_store_data64()
1130 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_store_data() local
1136 key_serial(op->key), vp->fid.vid, vp->fid.vnode); in afs_fs_store_data()
1138 size = (loff_t)op->store.last_to - (loff_t)op->store.first_offset; in afs_fs_store_data()
1139 if (op->store.first != op->store.last) in afs_fs_store_data()
1140 size += (loff_t)(op->store.last - op->store.first) << PAGE_SHIFT; in afs_fs_store_data()
1141 pos = (loff_t)op->store.first << PAGE_SHIFT; in afs_fs_store_data()
1142 pos += op->store.first_offset; in afs_fs_store_data()
1144 i_size = i_size_read(&vp->vnode->vfs_inode); in afs_fs_store_data()
1156 call = afs_alloc_flat_call(op->net, &afs_RXFSStoreData, in afs_fs_store_data()
1162 call->send_pages = true; in afs_fs_store_data()
1165 bp = call->request; in afs_fs_store_data()
1167 *bp++ = htonl(vp->fid.vid); in afs_fs_store_data()
1168 *bp++ = htonl(vp->fid.vnode); in afs_fs_store_data()
1169 *bp++ = htonl(vp->fid.unique); in afs_fs_store_data()
1172 *bp++ = htonl(op->mtime.tv_sec); /* mtime */ in afs_fs_store_data()
1182 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_store_data()
1216 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_setattr_size64() local
1218 struct iattr *attr = op->setattr.attr; in afs_fs_setattr_size64()
1222 key_serial(op->key), vp->fid.vid, vp->fid.vnode); in afs_fs_setattr_size64()
1224 ASSERT(attr->ia_valid & ATTR_SIZE); in afs_fs_setattr_size64()
1226 call = afs_alloc_flat_call(op->net, &afs_RXFSStoreData64_as_Status, in afs_fs_setattr_size64()
1233 bp = call->request; in afs_fs_setattr_size64()
1235 *bp++ = htonl(vp->fid.vid); in afs_fs_setattr_size64()
1236 *bp++ = htonl(vp->fid.vnode); in afs_fs_setattr_size64()
1237 *bp++ = htonl(vp->fid.unique); in afs_fs_setattr_size64()
1241 *bp++ = htonl(upper_32_bits(attr->ia_size)); /* position of start of write */ in afs_fs_setattr_size64()
1242 *bp++ = htonl(lower_32_bits(attr->ia_size)); in afs_fs_setattr_size64()
1245 *bp++ = htonl(upper_32_bits(attr->ia_size)); /* new file length */ in afs_fs_setattr_size64()
1246 *bp++ = htonl(lower_32_bits(attr->ia_size)); in afs_fs_setattr_size64()
1248 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_setattr_size64()
1258 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_setattr_size() local
1260 struct iattr *attr = op->setattr.attr; in afs_fs_setattr_size()
1264 key_serial(op->key), vp->fid.vid, vp->fid.vnode); in afs_fs_setattr_size()
1266 ASSERT(attr->ia_valid & ATTR_SIZE); in afs_fs_setattr_size()
1267 if (upper_32_bits(attr->ia_size)) in afs_fs_setattr_size()
1270 call = afs_alloc_flat_call(op->net, &afs_RXFSStoreData_as_Status, in afs_fs_setattr_size()
1277 bp = call->request; in afs_fs_setattr_size()
1279 *bp++ = htonl(vp->fid.vid); in afs_fs_setattr_size()
1280 *bp++ = htonl(vp->fid.vnode); in afs_fs_setattr_size()
1281 *bp++ = htonl(vp->fid.unique); in afs_fs_setattr_size()
1285 *bp++ = htonl(attr->ia_size); /* position of start of write */ in afs_fs_setattr_size()
1287 *bp++ = htonl(attr->ia_size); /* new file length */ in afs_fs_setattr_size()
1289 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_setattr_size()
1299 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_setattr() local
1301 struct iattr *attr = op->setattr.attr; in afs_fs_setattr()
1304 if (attr->ia_valid & ATTR_SIZE) in afs_fs_setattr()
1308 key_serial(op->key), vp->fid.vid, vp->fid.vnode); in afs_fs_setattr()
1310 call = afs_alloc_flat_call(op->net, &afs_RXFSStoreStatus, in afs_fs_setattr()
1317 bp = call->request; in afs_fs_setattr()
1319 *bp++ = htonl(vp->fid.vid); in afs_fs_setattr()
1320 *bp++ = htonl(vp->fid.vnode); in afs_fs_setattr()
1321 *bp++ = htonl(vp->fid.unique); in afs_fs_setattr()
1323 xdr_encode_AFS_StoreStatus(&bp, op->setattr.attr); in afs_fs_setattr()
1325 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_setattr()
1334 struct afs_operation *op = call->op; in afs_deliver_fs_get_volume_status()
1336 char *p; in afs_deliver_fs_get_volume_status() local
1340 _enter("{%u}", call->unmarshall); in afs_deliver_fs_get_volume_status()
1342 switch (call->unmarshall) { in afs_deliver_fs_get_volume_status()
1344 call->unmarshall++; in afs_deliver_fs_get_volume_status()
1355 bp = call->buffer; in afs_deliver_fs_get_volume_status()
1356 xdr_decode_AFSFetchVolumeStatus(&bp, &op->volstatus.vs); in afs_deliver_fs_get_volume_status()
1357 call->unmarshall++; in afs_deliver_fs_get_volume_status()
1367 call->count = ntohl(call->tmp); in afs_deliver_fs_get_volume_status()
1368 _debug("volname length: %u", call->count); in afs_deliver_fs_get_volume_status()
1369 if (call->count >= AFSNAMEMAX) in afs_deliver_fs_get_volume_status()
1371 size = (call->count + 3) & ~3; /* It's padded */ in afs_deliver_fs_get_volume_status()
1373 call->unmarshall++; in afs_deliver_fs_get_volume_status()
1383 p = call->buffer; in afs_deliver_fs_get_volume_status()
1384 p[call->count] = 0; in afs_deliver_fs_get_volume_status()
1385 _debug("volname '%s'", p); in afs_deliver_fs_get_volume_status()
1387 call->unmarshall++; in afs_deliver_fs_get_volume_status()
1396 call->count = ntohl(call->tmp); in afs_deliver_fs_get_volume_status()
1397 _debug("offline msg length: %u", call->count); in afs_deliver_fs_get_volume_status()
1398 if (call->count >= AFSNAMEMAX) in afs_deliver_fs_get_volume_status()
1400 size = (call->count + 3) & ~3; /* It's padded */ in afs_deliver_fs_get_volume_status()
1402 call->unmarshall++; in afs_deliver_fs_get_volume_status()
1412 p = call->buffer; in afs_deliver_fs_get_volume_status()
1413 p[call->count] = 0; in afs_deliver_fs_get_volume_status()
1414 _debug("offline '%s'", p); in afs_deliver_fs_get_volume_status()
1417 call->unmarshall++; in afs_deliver_fs_get_volume_status()
1426 call->count = ntohl(call->tmp); in afs_deliver_fs_get_volume_status()
1427 _debug("motd length: %u", call->count); in afs_deliver_fs_get_volume_status()
1428 if (call->count >= AFSNAMEMAX) in afs_deliver_fs_get_volume_status()
1430 size = (call->count + 3) & ~3; /* It's padded */ in afs_deliver_fs_get_volume_status()
1432 call->unmarshall++; in afs_deliver_fs_get_volume_status()
1442 p = call->buffer; in afs_deliver_fs_get_volume_status()
1443 p[call->count] = 0; in afs_deliver_fs_get_volume_status()
1444 _debug("motd '%s'", p); in afs_deliver_fs_get_volume_status()
1446 call->unmarshall++; in afs_deliver_fs_get_volume_status()
1471 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_get_volume_status() local
1477 call = afs_alloc_flat_call(op->net, &afs_RXFSGetVolumeStatus, 2 * 4, in afs_fs_get_volume_status()
1483 bp = call->request; in afs_fs_get_volume_status()
1485 bp[1] = htonl(vp->fid.vid); in afs_fs_get_volume_status()
1487 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_get_volume_status()
1496 struct afs_operation *op = call->op; in afs_deliver_fs_xxxx_lock()
1500 _enter("{%u}", call->unmarshall); in afs_deliver_fs_xxxx_lock()
1507 bp = call->buffer; in afs_deliver_fs_xxxx_lock()
1508 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_xxxx_lock()
1551 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_set_lock() local
1557 call = afs_alloc_flat_call(op->net, &afs_RXFSSetLock, 5 * 4, 6 * 4); in afs_fs_set_lock()
1562 bp = call->request; in afs_fs_set_lock()
1564 *bp++ = htonl(vp->fid.vid); in afs_fs_set_lock()
1565 *bp++ = htonl(vp->fid.vnode); in afs_fs_set_lock()
1566 *bp++ = htonl(vp->fid.unique); in afs_fs_set_lock()
1567 *bp++ = htonl(op->lock.type); in afs_fs_set_lock()
1569 trace_afs_make_fs_calli(call, &vp->fid, op->lock.type); in afs_fs_set_lock()
1578 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_extend_lock() local
1584 call = afs_alloc_flat_call(op->net, &afs_RXFSExtendLock, 4 * 4, 6 * 4); in afs_fs_extend_lock()
1589 bp = call->request; in afs_fs_extend_lock()
1591 *bp++ = htonl(vp->fid.vid); in afs_fs_extend_lock()
1592 *bp++ = htonl(vp->fid.vnode); in afs_fs_extend_lock()
1593 *bp++ = htonl(vp->fid.unique); in afs_fs_extend_lock()
1595 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_extend_lock()
1604 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_release_lock() local
1610 call = afs_alloc_flat_call(op->net, &afs_RXFSReleaseLock, 4 * 4, 6 * 4); in afs_fs_release_lock()
1615 bp = call->request; in afs_fs_release_lock()
1617 *bp++ = htonl(vp->fid.vid); in afs_fs_release_lock()
1618 *bp++ = htonl(vp->fid.vnode); in afs_fs_release_lock()
1619 *bp++ = htonl(vp->fid.unique); in afs_fs_release_lock()
1621 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_release_lock()
1658 return -ENOMEM; in afs_fs_give_up_all_callbacks()
1660 call->key = key; in afs_fs_give_up_all_callbacks()
1663 bp = call->request; in afs_fs_give_up_all_callbacks()
1666 call->server = afs_use_server(server, afs_server_trace_give_up_cb); in afs_fs_give_up_all_callbacks()
1679 _enter("{%u,%zu}", call->unmarshall, iov_iter_count(call->iter)); in afs_deliver_fs_get_capabilities()
1681 switch (call->unmarshall) { in afs_deliver_fs_get_capabilities()
1684 call->unmarshall++; in afs_deliver_fs_get_capabilities()
1693 count = ntohl(call->tmp); in afs_deliver_fs_get_capabilities()
1695 call->count = count; in afs_deliver_fs_get_capabilities()
1696 call->count2 = count; in afs_deliver_fs_get_capabilities()
1698 call->unmarshall++; in afs_deliver_fs_get_capabilities()
1709 call->unmarshall++; in afs_deliver_fs_get_capabilities()
1732 * ->done() - otherwise we return false to indicate we didn't even try.
1746 call->key = key; in afs_fs_get_capabilities()
1747 call->server = afs_use_server(server, afs_server_trace_get_caps); in afs_fs_get_capabilities()
1748 call->upgrade = true; in afs_fs_get_capabilities()
1749 call->async = true; in afs_fs_get_capabilities()
1750 call->max_lifespan = AFS_PROBE_MAX_LIFESPAN; in afs_fs_get_capabilities()
1753 bp = call->request; in afs_fs_get_capabilities()
1767 struct afs_operation *op = call->op; in afs_deliver_fs_inline_bulk_status()
1773 _enter("{%u}", call->unmarshall); in afs_deliver_fs_inline_bulk_status()
1775 switch (call->unmarshall) { in afs_deliver_fs_inline_bulk_status()
1778 call->unmarshall++; in afs_deliver_fs_inline_bulk_status()
1788 tmp = ntohl(call->tmp); in afs_deliver_fs_inline_bulk_status()
1789 _debug("status count: %u/%u", tmp, op->nr_files); in afs_deliver_fs_inline_bulk_status()
1790 if (tmp != op->nr_files) in afs_deliver_fs_inline_bulk_status()
1793 call->count = 0; in afs_deliver_fs_inline_bulk_status()
1794 call->unmarshall++; in afs_deliver_fs_inline_bulk_status()
1800 _debug("extract status array %u", call->count); in afs_deliver_fs_inline_bulk_status()
1805 switch (call->count) { in afs_deliver_fs_inline_bulk_status()
1807 scb = &op->file[0].scb; in afs_deliver_fs_inline_bulk_status()
1810 scb = &op->file[1].scb; in afs_deliver_fs_inline_bulk_status()
1813 scb = &op->more_files[call->count - 2].scb; in afs_deliver_fs_inline_bulk_status()
1817 bp = call->buffer; in afs_deliver_fs_inline_bulk_status()
1820 call->count++; in afs_deliver_fs_inline_bulk_status()
1821 if (call->count < op->nr_files) in afs_deliver_fs_inline_bulk_status()
1824 call->count = 0; in afs_deliver_fs_inline_bulk_status()
1825 call->unmarshall++; in afs_deliver_fs_inline_bulk_status()
1836 tmp = ntohl(call->tmp); in afs_deliver_fs_inline_bulk_status()
1838 if (tmp != op->nr_files) in afs_deliver_fs_inline_bulk_status()
1840 call->count = 0; in afs_deliver_fs_inline_bulk_status()
1841 call->unmarshall++; in afs_deliver_fs_inline_bulk_status()
1853 switch (call->count) { in afs_deliver_fs_inline_bulk_status()
1855 scb = &op->file[0].scb; in afs_deliver_fs_inline_bulk_status()
1858 scb = &op->file[1].scb; in afs_deliver_fs_inline_bulk_status()
1861 scb = &op->more_files[call->count - 2].scb; in afs_deliver_fs_inline_bulk_status()
1865 bp = call->buffer; in afs_deliver_fs_inline_bulk_status()
1867 call->count++; in afs_deliver_fs_inline_bulk_status()
1868 if (call->count < op->nr_files) in afs_deliver_fs_inline_bulk_status()
1872 call->unmarshall++; in afs_deliver_fs_inline_bulk_status()
1880 bp = call->buffer; in afs_deliver_fs_inline_bulk_status()
1881 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_inline_bulk_status()
1883 call->unmarshall++; in afs_deliver_fs_inline_bulk_status()
1895 if (call->error == -ECONNABORTED && in afs_done_fs_inline_bulk_status()
1896 call->abort_code == RX_INVALID_OPERATION) { in afs_done_fs_inline_bulk_status()
1897 set_bit(AFS_SERVER_FL_NO_IBULK, &call->server->flags); in afs_done_fs_inline_bulk_status()
1898 if (call->op) in afs_done_fs_inline_bulk_status()
1899 set_bit(AFS_VOLUME_MAYBE_NO_IBULK, &call->op->volume->flags); in afs_done_fs_inline_bulk_status()
1919 struct afs_vnode_param *dvp = &op->file[0]; in afs_fs_inline_bulk_status()
1920 struct afs_vnode_param *vp = &op->file[1]; in afs_fs_inline_bulk_status() local
1925 if (test_bit(AFS_SERVER_FL_NO_IBULK, &op->server->flags)) { in afs_fs_inline_bulk_status()
1926 op->error = -ENOTSUPP; in afs_fs_inline_bulk_status()
1931 key_serial(op->key), vp->fid.vid, vp->fid.vnode, op->nr_files); in afs_fs_inline_bulk_status()
1933 call = afs_alloc_flat_call(op->net, &afs_RXFSInlineBulkStatus, in afs_fs_inline_bulk_status()
1934 (2 + op->nr_files * 3) * 4, in afs_fs_inline_bulk_status()
1940 bp = call->request; in afs_fs_inline_bulk_status()
1942 *bp++ = htonl(op->nr_files); in afs_fs_inline_bulk_status()
1943 *bp++ = htonl(dvp->fid.vid); in afs_fs_inline_bulk_status()
1944 *bp++ = htonl(dvp->fid.vnode); in afs_fs_inline_bulk_status()
1945 *bp++ = htonl(dvp->fid.unique); in afs_fs_inline_bulk_status()
1946 *bp++ = htonl(vp->fid.vid); in afs_fs_inline_bulk_status()
1947 *bp++ = htonl(vp->fid.vnode); in afs_fs_inline_bulk_status()
1948 *bp++ = htonl(vp->fid.unique); in afs_fs_inline_bulk_status()
1949 for (i = 0; i < op->nr_files - 2; i++) { in afs_fs_inline_bulk_status()
1950 *bp++ = htonl(op->more_files[i].fid.vid); in afs_fs_inline_bulk_status()
1951 *bp++ = htonl(op->more_files[i].fid.vnode); in afs_fs_inline_bulk_status()
1952 *bp++ = htonl(op->more_files[i].fid.unique); in afs_fs_inline_bulk_status()
1955 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_inline_bulk_status()
1964 struct afs_operation *op = call->op; in afs_deliver_fs_fetch_acl()
1965 struct afs_vnode_param *vp = &op->file[0]; in afs_deliver_fs_fetch_acl() local
1971 _enter("{%u}", call->unmarshall); in afs_deliver_fs_fetch_acl()
1973 switch (call->unmarshall) { in afs_deliver_fs_fetch_acl()
1976 call->unmarshall++; in afs_deliver_fs_fetch_acl()
1985 size = call->count2 = ntohl(call->tmp); in afs_deliver_fs_fetch_acl()
1990 return -ENOMEM; in afs_deliver_fs_fetch_acl()
1991 op->acl = acl; in afs_deliver_fs_fetch_acl()
1992 acl->size = call->count2; in afs_deliver_fs_fetch_acl()
1993 afs_extract_begin(call, acl->data, size); in afs_deliver_fs_fetch_acl()
1994 call->unmarshall++; in afs_deliver_fs_fetch_acl()
2004 call->unmarshall++; in afs_deliver_fs_fetch_acl()
2013 bp = call->buffer; in afs_deliver_fs_fetch_acl()
2014 xdr_decode_AFSFetchStatus(&bp, call, &vp->scb); in afs_deliver_fs_fetch_acl()
2015 xdr_decode_AFSVolSync(&bp, &op->volsync); in afs_deliver_fs_fetch_acl()
2017 call->unmarshall++; in afs_deliver_fs_fetch_acl()
2041 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_fetch_acl() local
2046 key_serial(op->key), vp->fid.vid, vp->fid.vnode); in afs_fs_fetch_acl()
2048 call = afs_alloc_flat_call(op->net, &afs_RXFSFetchACL, 16, (21 + 6) * 4); in afs_fs_fetch_acl()
2053 bp = call->request; in afs_fs_fetch_acl()
2055 bp[1] = htonl(vp->fid.vid); in afs_fs_fetch_acl()
2056 bp[2] = htonl(vp->fid.vnode); in afs_fs_fetch_acl()
2057 bp[3] = htonl(vp->fid.unique); in afs_fs_fetch_acl()
2059 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_fetch_acl()
2078 struct afs_vnode_param *vp = &op->file[0]; in afs_fs_store_acl() local
2080 const struct afs_acl *acl = op->acl; in afs_fs_store_acl()
2085 key_serial(op->key), vp->fid.vid, vp->fid.vnode); in afs_fs_store_acl()
2087 size = round_up(acl->size, 4); in afs_fs_store_acl()
2088 call = afs_alloc_flat_call(op->net, &afs_RXFSStoreACL, in afs_fs_store_acl()
2094 bp = call->request; in afs_fs_store_acl()
2096 bp[1] = htonl(vp->fid.vid); in afs_fs_store_acl()
2097 bp[2] = htonl(vp->fid.vnode); in afs_fs_store_acl()
2098 bp[3] = htonl(vp->fid.unique); in afs_fs_store_acl()
2099 bp[4] = htonl(acl->size); in afs_fs_store_acl()
2100 memcpy(&bp[5], acl->data, acl->size); in afs_fs_store_acl()
2101 if (acl->size != size) in afs_fs_store_acl()
2102 memset((void *)&bp[5] + acl->size, 0, size - acl->size); in afs_fs_store_acl()
2104 trace_afs_make_fs_call(call, &vp->fid); in afs_fs_store_acl()