yfsclient.c (781070551c26def14784ce5ca14194d7ca234b04) | yfsclient.c (87182759cd6f94875d6aaaac74eaa52aa6aa6f98) |
---|---|
1/* YFS File Server client stubs 2 * 3 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved. 4 * Written by David Howells (dhowells@redhat.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public Licence 8 * as published by the Free Software Foundation; either version --- 324 unchanged lines hidden (view full) --- 333static void xdr_decode_YFSCallBack(struct afs_call *call, 334 struct afs_vnode *vnode, 335 const __be32 **_bp) 336{ 337 struct afs_cb_interest *old, *cbi = call->cbi; 338 struct afs_callback cb; 339 340 xdr_decode_YFSCallBack_raw(call, &cb, _bp); | 1/* YFS File Server client stubs 2 * 3 * Copyright (C) 2018 Red Hat, Inc. All Rights Reserved. 4 * Written by David Howells (dhowells@redhat.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public Licence 8 * as published by the Free Software Foundation; either version --- 324 unchanged lines hidden (view full) --- 333static void xdr_decode_YFSCallBack(struct afs_call *call, 334 struct afs_vnode *vnode, 335 const __be32 **_bp) 336{ 337 struct afs_cb_interest *old, *cbi = call->cbi; 338 struct afs_callback cb; 339 340 xdr_decode_YFSCallBack_raw(call, &cb, _bp); |
341 | 341 |
342 write_seqlock(&vnode->cb_lock); 343 344 if (!afs_cb_is_broken(call->cb_break, vnode, cbi)) { 345 vnode->cb_version = cb.version; 346 vnode->cb_type = cb.type; 347 vnode->cb_expires_at = cb.expires_at; 348 old = vnode->cb_interest; 349 if (old != call->cbi) { --- 90 unchanged lines hidden (view full) --- 440 *_bp += sizeof(*x) / sizeof(__be32); 441} 442 443/* 444 * deliver reply data to an FS.FetchStatus 445 */ 446static int yfs_deliver_fs_fetch_status_vnode(struct afs_call *call) 447{ | 342 write_seqlock(&vnode->cb_lock); 343 344 if (!afs_cb_is_broken(call->cb_break, vnode, cbi)) { 345 vnode->cb_version = cb.version; 346 vnode->cb_type = cb.type; 347 vnode->cb_expires_at = cb.expires_at; 348 old = vnode->cb_interest; 349 if (old != call->cbi) { --- 90 unchanged lines hidden (view full) --- 440 *_bp += sizeof(*x) / sizeof(__be32); 441} 442 443/* 444 * deliver reply data to an FS.FetchStatus 445 */ 446static int yfs_deliver_fs_fetch_status_vnode(struct afs_call *call) 447{ |
448 struct afs_vnode *vnode = call->reply[0]; | 448 struct afs_vnode *vnode = call->xvnode; |
449 const __be32 *bp; 450 int ret; 451 452 ret = afs_transfer_reply(call); 453 if (ret < 0) 454 return ret; 455 456 _enter("{%llx:%llu}", vnode->fid.vid, vnode->fid.vnode); 457 458 /* unmarshall the reply once we've received all of it */ 459 bp = call->buffer; 460 ret = yfs_decode_status(call, &bp, &vnode->status, vnode, 461 &call->expected_version, NULL); 462 if (ret < 0) 463 return ret; 464 xdr_decode_YFSCallBack(call, vnode, &bp); | 449 const __be32 *bp; 450 int ret; 451 452 ret = afs_transfer_reply(call); 453 if (ret < 0) 454 return ret; 455 456 _enter("{%llx:%llu}", vnode->fid.vid, vnode->fid.vnode); 457 458 /* unmarshall the reply once we've received all of it */ 459 bp = call->buffer; 460 ret = yfs_decode_status(call, &bp, &vnode->status, vnode, 461 &call->expected_version, NULL); 462 if (ret < 0) 463 return ret; 464 xdr_decode_YFSCallBack(call, vnode, &bp); |
465 xdr_decode_YFSVolSync(&bp, call->reply[1]); | 465 xdr_decode_YFSVolSync(&bp, call->out_volsync); |
466 467 _leave(" = 0 [done]"); 468 return 0; 469} 470 471/* 472 * YFS.FetchStatus operation type 473 */ --- 25 unchanged lines hidden (view full) --- 499 sizeof(struct yfs_xdr_YFSCallBack) + 500 sizeof(struct yfs_xdr_YFSVolSync)); 501 if (!call) { 502 fc->ac.error = -ENOMEM; 503 return -ENOMEM; 504 } 505 506 call->key = fc->key; | 466 467 _leave(" = 0 [done]"); 468 return 0; 469} 470 471/* 472 * YFS.FetchStatus operation type 473 */ --- 25 unchanged lines hidden (view full) --- 499 sizeof(struct yfs_xdr_YFSCallBack) + 500 sizeof(struct yfs_xdr_YFSVolSync)); 501 if (!call) { 502 fc->ac.error = -ENOMEM; 503 return -ENOMEM; 504 } 505 506 call->key = fc->key; |
507 call->reply[0] = vnode; 508 call->reply[1] = volsync; | 507 call->xvnode = vnode; 508 call->out_volsync = volsync; |
509 call->expected_version = new_inode ? 1 : vnode->status.data_version; 510 511 /* marshall the parameters */ 512 bp = call->request; 513 bp = xdr_encode_u32(bp, YFSFETCHSTATUS); 514 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 515 bp = xdr_encode_YFSFid(bp, &vnode->fid); 516 yfs_check_req(call, bp); --- 6 unchanged lines hidden (view full) --- 523 return afs_wait_for_call_to_complete(call, &fc->ac); 524} 525 526/* 527 * Deliver reply data to an YFS.FetchData64. 528 */ 529static int yfs_deliver_fs_fetch_data64(struct afs_call *call) 530{ | 509 call->expected_version = new_inode ? 1 : vnode->status.data_version; 510 511 /* marshall the parameters */ 512 bp = call->request; 513 bp = xdr_encode_u32(bp, YFSFETCHSTATUS); 514 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 515 bp = xdr_encode_YFSFid(bp, &vnode->fid); 516 yfs_check_req(call, bp); --- 6 unchanged lines hidden (view full) --- 523 return afs_wait_for_call_to_complete(call, &fc->ac); 524} 525 526/* 527 * Deliver reply data to an YFS.FetchData64. 528 */ 529static int yfs_deliver_fs_fetch_data64(struct afs_call *call) 530{ |
531 struct afs_vnode *vnode = call->reply[0]; 532 struct afs_read *req = call->reply[2]; | 531 struct afs_vnode *vnode = call->xvnode; 532 struct afs_read *req = call->read_request; |
533 const __be32 *bp; 534 unsigned int size; 535 int ret; 536 537 _enter("{%u,%zu/%llu}", 538 call->unmarshall, iov_iter_count(&call->iter), req->actual_len); 539 540 switch (call->unmarshall) { --- 82 unchanged lines hidden (view full) --- 623 return ret; 624 625 bp = call->buffer; 626 ret = yfs_decode_status(call, &bp, &vnode->status, vnode, 627 &vnode->status.data_version, req); 628 if (ret < 0) 629 return ret; 630 xdr_decode_YFSCallBack(call, vnode, &bp); | 533 const __be32 *bp; 534 unsigned int size; 535 int ret; 536 537 _enter("{%u,%zu/%llu}", 538 call->unmarshall, iov_iter_count(&call->iter), req->actual_len); 539 540 switch (call->unmarshall) { --- 82 unchanged lines hidden (view full) --- 623 return ret; 624 625 bp = call->buffer; 626 ret = yfs_decode_status(call, &bp, &vnode->status, vnode, 627 &vnode->status.data_version, req); 628 if (ret < 0) 629 return ret; 630 xdr_decode_YFSCallBack(call, vnode, &bp); |
631 xdr_decode_YFSVolSync(&bp, call->reply[1]); | 631 xdr_decode_YFSVolSync(&bp, call->out_volsync); |
632 633 call->unmarshall++; 634 635 /* Fall through */ 636 case 5: 637 break; 638 } 639 --- 7 unchanged lines hidden (view full) --- 647 } 648 649 _leave(" = 0 [done]"); 650 return 0; 651} 652 653static void yfs_fetch_data_destructor(struct afs_call *call) 654{ | 632 633 call->unmarshall++; 634 635 /* Fall through */ 636 case 5: 637 break; 638 } 639 --- 7 unchanged lines hidden (view full) --- 647 } 648 649 _leave(" = 0 [done]"); 650 return 0; 651} 652 653static void yfs_fetch_data_destructor(struct afs_call *call) 654{ |
655 struct afs_read *req = call->reply[2]; 656 657 afs_put_read(req); | 655 afs_put_read(call->read_request); |
658 afs_flat_call_destructor(call); 659} 660 661/* 662 * YFS.FetchData64 operation type 663 */ 664static const struct afs_call_type yfs_RXYFSFetchData64 = { 665 .name = "YFS.FetchData64", --- 22 unchanged lines hidden (view full) --- 688 sizeof(struct yfs_xdr_u64) * 2, 689 sizeof(struct yfs_xdr_YFSFetchStatus) + 690 sizeof(struct yfs_xdr_YFSCallBack) + 691 sizeof(struct yfs_xdr_YFSVolSync)); 692 if (!call) 693 return -ENOMEM; 694 695 call->key = fc->key; | 656 afs_flat_call_destructor(call); 657} 658 659/* 660 * YFS.FetchData64 operation type 661 */ 662static const struct afs_call_type yfs_RXYFSFetchData64 = { 663 .name = "YFS.FetchData64", --- 22 unchanged lines hidden (view full) --- 686 sizeof(struct yfs_xdr_u64) * 2, 687 sizeof(struct yfs_xdr_YFSFetchStatus) + 688 sizeof(struct yfs_xdr_YFSCallBack) + 689 sizeof(struct yfs_xdr_YFSVolSync)); 690 if (!call) 691 return -ENOMEM; 692 693 call->key = fc->key; |
696 call->reply[0] = vnode; 697 call->reply[1] = NULL; /* volsync */ 698 call->reply[2] = req; | 694 call->xvnode = vnode; 695 call->out_volsync = NULL; 696 call->read_request = req; |
699 call->expected_version = vnode->status.data_version; 700 call->want_reply_time = true; 701 702 /* marshall the parameters */ 703 bp = call->request; 704 bp = xdr_encode_u32(bp, YFSFETCHDATA64); 705 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 706 bp = xdr_encode_YFSFid(bp, &vnode->fid); --- 10 unchanged lines hidden (view full) --- 717 return afs_wait_for_call_to_complete(call, &fc->ac); 718} 719 720/* 721 * Deliver reply data for YFS.CreateFile or YFS.MakeDir. 722 */ 723static int yfs_deliver_fs_create_vnode(struct afs_call *call) 724{ | 697 call->expected_version = vnode->status.data_version; 698 call->want_reply_time = true; 699 700 /* marshall the parameters */ 701 bp = call->request; 702 bp = xdr_encode_u32(bp, YFSFETCHDATA64); 703 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 704 bp = xdr_encode_YFSFid(bp, &vnode->fid); --- 10 unchanged lines hidden (view full) --- 715 return afs_wait_for_call_to_complete(call, &fc->ac); 716} 717 718/* 719 * Deliver reply data for YFS.CreateFile or YFS.MakeDir. 720 */ 721static int yfs_deliver_fs_create_vnode(struct afs_call *call) 722{ |
725 struct afs_vnode *vnode = call->reply[0]; | 723 struct afs_vnode *dvnode = call->dvnode; |
726 const __be32 *bp; 727 int ret; 728 729 _enter("{%u}", call->unmarshall); 730 731 ret = afs_transfer_reply(call); 732 if (ret < 0) 733 return ret; 734 735 /* unmarshall the reply once we've received all of it */ 736 bp = call->buffer; | 724 const __be32 *bp; 725 int ret; 726 727 _enter("{%u}", call->unmarshall); 728 729 ret = afs_transfer_reply(call); 730 if (ret < 0) 731 return ret; 732 733 /* unmarshall the reply once we've received all of it */ 734 bp = call->buffer; |
737 xdr_decode_YFSFid(&bp, call->reply[1]); 738 ret = yfs_decode_status(call, &bp, call->reply[2], NULL, NULL, NULL); | 735 xdr_decode_YFSFid(&bp, call->out_fid); 736 ret = yfs_decode_status(call, &bp, call->out_extra_status, NULL, NULL, NULL); |
739 if (ret < 0) 740 return ret; | 737 if (ret < 0) 738 return ret; |
741 ret = yfs_decode_status(call, &bp, &vnode->status, vnode, | 739 ret = yfs_decode_status(call, &bp, &dvnode->status, dvnode, |
742 &call->expected_version, NULL); 743 if (ret < 0) 744 return ret; | 740 &call->expected_version, NULL); 741 if (ret < 0) 742 return ret; |
745 xdr_decode_YFSCallBack_raw(call, call->reply[3], &bp); | 743 xdr_decode_YFSCallBack_raw(call, call->out_cb, &bp); |
746 xdr_decode_YFSVolSync(&bp, NULL); 747 748 _leave(" = 0 [done]"); 749 return 0; 750} 751 752/* 753 * FS.CreateFile and FS.MakeDir operation type --- 11 unchanged lines hidden (view full) --- 765int yfs_fs_create_file(struct afs_fs_cursor *fc, 766 const char *name, 767 umode_t mode, 768 u64 current_data_version, 769 struct afs_fid *newfid, 770 struct afs_file_status *newstatus, 771 struct afs_callback *newcb) 772{ | 744 xdr_decode_YFSVolSync(&bp, NULL); 745 746 _leave(" = 0 [done]"); 747 return 0; 748} 749 750/* 751 * FS.CreateFile and FS.MakeDir operation type --- 11 unchanged lines hidden (view full) --- 763int yfs_fs_create_file(struct afs_fs_cursor *fc, 764 const char *name, 765 umode_t mode, 766 u64 current_data_version, 767 struct afs_fid *newfid, 768 struct afs_file_status *newstatus, 769 struct afs_callback *newcb) 770{ |
773 struct afs_vnode *vnode = fc->vnode; | 771 struct afs_vnode *dvnode = fc->vnode; |
774 struct afs_call *call; | 772 struct afs_call *call; |
775 struct afs_net *net = afs_v2net(vnode); | 773 struct afs_net *net = afs_v2net(dvnode); |
776 size_t namesz, reqsz, rplsz; 777 __be32 *bp; 778 779 _enter(""); 780 781 namesz = strlen(name); 782 reqsz = (sizeof(__be32) + 783 sizeof(__be32) + --- 7 unchanged lines hidden (view full) --- 791 sizeof(struct yfs_xdr_YFSCallBack) + 792 sizeof(struct yfs_xdr_YFSVolSync)); 793 794 call = afs_alloc_flat_call(net, &afs_RXFSCreateFile, reqsz, rplsz); 795 if (!call) 796 return -ENOMEM; 797 798 call->key = fc->key; | 774 size_t namesz, reqsz, rplsz; 775 __be32 *bp; 776 777 _enter(""); 778 779 namesz = strlen(name); 780 reqsz = (sizeof(__be32) + 781 sizeof(__be32) + --- 7 unchanged lines hidden (view full) --- 789 sizeof(struct yfs_xdr_YFSCallBack) + 790 sizeof(struct yfs_xdr_YFSVolSync)); 791 792 call = afs_alloc_flat_call(net, &afs_RXFSCreateFile, reqsz, rplsz); 793 if (!call) 794 return -ENOMEM; 795 796 call->key = fc->key; |
799 call->reply[0] = vnode; 800 call->reply[1] = newfid; 801 call->reply[2] = newstatus; 802 call->reply[3] = newcb; | 797 call->dvnode = dvnode; 798 call->out_fid = newfid; 799 call->out_extra_status = newstatus; 800 call->out_cb = newcb; |
803 call->expected_version = current_data_version + 1; 804 805 /* marshall the parameters */ 806 bp = call->request; 807 bp = xdr_encode_u32(bp, YFSCREATEFILE); 808 bp = xdr_encode_u32(bp, 0); /* RPC flags */ | 801 call->expected_version = current_data_version + 1; 802 803 /* marshall the parameters */ 804 bp = call->request; 805 bp = xdr_encode_u32(bp, YFSCREATEFILE); 806 bp = xdr_encode_u32(bp, 0); /* RPC flags */ |
809 bp = xdr_encode_YFSFid(bp, &vnode->fid); | 807 bp = xdr_encode_YFSFid(bp, &dvnode->fid); |
810 bp = xdr_encode_string(bp, name, namesz); 811 bp = xdr_encode_YFSStoreStatus_mode(bp, mode); 812 bp = xdr_encode_u32(bp, yfs_LockNone); /* ViceLockType */ 813 yfs_check_req(call, bp); 814 815 afs_use_fs_server(call, fc->cbi); | 808 bp = xdr_encode_string(bp, name, namesz); 809 bp = xdr_encode_YFSStoreStatus_mode(bp, mode); 810 bp = xdr_encode_u32(bp, yfs_LockNone); /* ViceLockType */ 811 yfs_check_req(call, bp); 812 813 afs_use_fs_server(call, fc->cbi); |
816 trace_afs_make_fs_call1(call, &vnode->fid, name); | 814 trace_afs_make_fs_call1(call, &dvnode->fid, name); |
817 afs_set_fc_call(call, fc); 818 afs_make_call(&fc->ac, call, GFP_NOFS); 819 return afs_wait_for_call_to_complete(call, &fc->ac); 820} 821 822static const struct afs_call_type yfs_RXFSMakeDir = { 823 .name = "YFS.MakeDir", 824 .op = yfs_FS_MakeDir, --- 7 unchanged lines hidden (view full) --- 832int yfs_fs_make_dir(struct afs_fs_cursor *fc, 833 const char *name, 834 umode_t mode, 835 u64 current_data_version, 836 struct afs_fid *newfid, 837 struct afs_file_status *newstatus, 838 struct afs_callback *newcb) 839{ | 815 afs_set_fc_call(call, fc); 816 afs_make_call(&fc->ac, call, GFP_NOFS); 817 return afs_wait_for_call_to_complete(call, &fc->ac); 818} 819 820static const struct afs_call_type yfs_RXFSMakeDir = { 821 .name = "YFS.MakeDir", 822 .op = yfs_FS_MakeDir, --- 7 unchanged lines hidden (view full) --- 830int yfs_fs_make_dir(struct afs_fs_cursor *fc, 831 const char *name, 832 umode_t mode, 833 u64 current_data_version, 834 struct afs_fid *newfid, 835 struct afs_file_status *newstatus, 836 struct afs_callback *newcb) 837{ |
840 struct afs_vnode *vnode = fc->vnode; | 838 struct afs_vnode *dvnode = fc->vnode; |
841 struct afs_call *call; | 839 struct afs_call *call; |
842 struct afs_net *net = afs_v2net(vnode); | 840 struct afs_net *net = afs_v2net(dvnode); |
843 size_t namesz, reqsz, rplsz; 844 __be32 *bp; 845 846 _enter(""); 847 848 namesz = strlen(name); 849 reqsz = (sizeof(__be32) + 850 sizeof(struct yfs_xdr_RPCFlags) + --- 6 unchanged lines hidden (view full) --- 857 sizeof(struct yfs_xdr_YFSCallBack) + 858 sizeof(struct yfs_xdr_YFSVolSync)); 859 860 call = afs_alloc_flat_call(net, &yfs_RXFSMakeDir, reqsz, rplsz); 861 if (!call) 862 return -ENOMEM; 863 864 call->key = fc->key; | 841 size_t namesz, reqsz, rplsz; 842 __be32 *bp; 843 844 _enter(""); 845 846 namesz = strlen(name); 847 reqsz = (sizeof(__be32) + 848 sizeof(struct yfs_xdr_RPCFlags) + --- 6 unchanged lines hidden (view full) --- 855 sizeof(struct yfs_xdr_YFSCallBack) + 856 sizeof(struct yfs_xdr_YFSVolSync)); 857 858 call = afs_alloc_flat_call(net, &yfs_RXFSMakeDir, reqsz, rplsz); 859 if (!call) 860 return -ENOMEM; 861 862 call->key = fc->key; |
865 call->reply[0] = vnode; 866 call->reply[1] = newfid; 867 call->reply[2] = newstatus; 868 call->reply[3] = newcb; | 863 call->dvnode = dvnode; 864 call->out_fid = newfid; 865 call->out_extra_status = newstatus; 866 call->out_cb = newcb; |
869 call->expected_version = current_data_version + 1; 870 871 /* marshall the parameters */ 872 bp = call->request; 873 bp = xdr_encode_u32(bp, YFSMAKEDIR); 874 bp = xdr_encode_u32(bp, 0); /* RPC flags */ | 867 call->expected_version = current_data_version + 1; 868 869 /* marshall the parameters */ 870 bp = call->request; 871 bp = xdr_encode_u32(bp, YFSMAKEDIR); 872 bp = xdr_encode_u32(bp, 0); /* RPC flags */ |
875 bp = xdr_encode_YFSFid(bp, &vnode->fid); | 873 bp = xdr_encode_YFSFid(bp, &dvnode->fid); |
876 bp = xdr_encode_string(bp, name, namesz); 877 bp = xdr_encode_YFSStoreStatus_mode(bp, mode); 878 yfs_check_req(call, bp); 879 880 afs_use_fs_server(call, fc->cbi); | 874 bp = xdr_encode_string(bp, name, namesz); 875 bp = xdr_encode_YFSStoreStatus_mode(bp, mode); 876 yfs_check_req(call, bp); 877 878 afs_use_fs_server(call, fc->cbi); |
881 trace_afs_make_fs_call1(call, &vnode->fid, name); | 879 trace_afs_make_fs_call1(call, &dvnode->fid, name); |
882 afs_set_fc_call(call, fc); 883 afs_make_call(&fc->ac, call, GFP_NOFS); 884 return afs_wait_for_call_to_complete(call, &fc->ac); 885} 886 887/* 888 * Deliver reply data to a YFS.RemoveFile2 operation. 889 */ 890static int yfs_deliver_fs_remove_file2(struct afs_call *call) 891{ | 880 afs_set_fc_call(call, fc); 881 afs_make_call(&fc->ac, call, GFP_NOFS); 882 return afs_wait_for_call_to_complete(call, &fc->ac); 883} 884 885/* 886 * Deliver reply data to a YFS.RemoveFile2 operation. 887 */ 888static int yfs_deliver_fs_remove_file2(struct afs_call *call) 889{ |
892 struct afs_vnode *dvnode = call->reply[0]; 893 struct afs_vnode *vnode = call->reply[1]; | 890 struct afs_vnode *dvnode = call->dvnode; 891 struct afs_vnode *vnode = call->xvnode; |
894 struct afs_fid fid; 895 const __be32 *bp; 896 int ret; 897 898 _enter("{%u}", call->unmarshall); 899 900 ret = afs_transfer_reply(call); 901 if (ret < 0) --- 50 unchanged lines hidden (view full) --- 952 sizeof(struct yfs_xdr_YFSFetchStatus) + 953 sizeof(struct yfs_xdr_YFSFid) + 954 sizeof(struct yfs_xdr_YFSFetchStatus) + 955 sizeof(struct yfs_xdr_YFSVolSync)); 956 if (!call) 957 return -ENOMEM; 958 959 call->key = fc->key; | 892 struct afs_fid fid; 893 const __be32 *bp; 894 int ret; 895 896 _enter("{%u}", call->unmarshall); 897 898 ret = afs_transfer_reply(call); 899 if (ret < 0) --- 50 unchanged lines hidden (view full) --- 950 sizeof(struct yfs_xdr_YFSFetchStatus) + 951 sizeof(struct yfs_xdr_YFSFid) + 952 sizeof(struct yfs_xdr_YFSFetchStatus) + 953 sizeof(struct yfs_xdr_YFSVolSync)); 954 if (!call) 955 return -ENOMEM; 956 957 call->key = fc->key; |
960 call->reply[0] = dvnode; 961 call->reply[1] = vnode; | 958 call->dvnode = dvnode; 959 call->xvnode = vnode; |
962 call->expected_version = current_data_version + 1; 963 964 /* marshall the parameters */ 965 bp = call->request; 966 bp = xdr_encode_u32(bp, YFSREMOVEFILE2); 967 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 968 bp = xdr_encode_YFSFid(bp, &dvnode->fid); 969 bp = xdr_encode_string(bp, name, namesz); --- 6 unchanged lines hidden (view full) --- 976 return afs_wait_for_call_to_complete(call, &fc->ac); 977} 978 979/* 980 * Deliver reply data to a YFS.RemoveFile or YFS.RemoveDir operation. 981 */ 982static int yfs_deliver_fs_remove(struct afs_call *call) 983{ | 960 call->expected_version = current_data_version + 1; 961 962 /* marshall the parameters */ 963 bp = call->request; 964 bp = xdr_encode_u32(bp, YFSREMOVEFILE2); 965 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 966 bp = xdr_encode_YFSFid(bp, &dvnode->fid); 967 bp = xdr_encode_string(bp, name, namesz); --- 6 unchanged lines hidden (view full) --- 974 return afs_wait_for_call_to_complete(call, &fc->ac); 975} 976 977/* 978 * Deliver reply data to a YFS.RemoveFile or YFS.RemoveDir operation. 979 */ 980static int yfs_deliver_fs_remove(struct afs_call *call) 981{ |
984 struct afs_vnode *dvnode = call->reply[0]; | 982 struct afs_vnode *dvnode = call->dvnode; |
985 const __be32 *bp; 986 int ret; 987 988 _enter("{%u}", call->unmarshall); 989 990 ret = afs_transfer_reply(call); 991 if (ret < 0) 992 return ret; --- 48 unchanged lines hidden (view full) --- 1041 sizeof(struct yfs_xdr_YFSFid) + 1042 xdr_strlen(namesz), 1043 sizeof(struct yfs_xdr_YFSFetchStatus) + 1044 sizeof(struct yfs_xdr_YFSVolSync)); 1045 if (!call) 1046 return -ENOMEM; 1047 1048 call->key = fc->key; | 983 const __be32 *bp; 984 int ret; 985 986 _enter("{%u}", call->unmarshall); 987 988 ret = afs_transfer_reply(call); 989 if (ret < 0) 990 return ret; --- 48 unchanged lines hidden (view full) --- 1039 sizeof(struct yfs_xdr_YFSFid) + 1040 xdr_strlen(namesz), 1041 sizeof(struct yfs_xdr_YFSFetchStatus) + 1042 sizeof(struct yfs_xdr_YFSVolSync)); 1043 if (!call) 1044 return -ENOMEM; 1045 1046 call->key = fc->key; |
1049 call->reply[0] = dvnode; 1050 call->reply[1] = vnode; | 1047 call->dvnode = dvnode; 1048 call->xvnode = vnode; |
1051 call->expected_version = current_data_version + 1; 1052 1053 /* marshall the parameters */ 1054 bp = call->request; 1055 bp = xdr_encode_u32(bp, isdir ? YFSREMOVEDIR : YFSREMOVEFILE); 1056 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1057 bp = xdr_encode_YFSFid(bp, &dvnode->fid); 1058 bp = xdr_encode_string(bp, name, namesz); --- 6 unchanged lines hidden (view full) --- 1065 return afs_wait_for_call_to_complete(call, &fc->ac); 1066} 1067 1068/* 1069 * Deliver reply data to a YFS.Link operation. 1070 */ 1071static int yfs_deliver_fs_link(struct afs_call *call) 1072{ | 1049 call->expected_version = current_data_version + 1; 1050 1051 /* marshall the parameters */ 1052 bp = call->request; 1053 bp = xdr_encode_u32(bp, isdir ? YFSREMOVEDIR : YFSREMOVEFILE); 1054 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1055 bp = xdr_encode_YFSFid(bp, &dvnode->fid); 1056 bp = xdr_encode_string(bp, name, namesz); --- 6 unchanged lines hidden (view full) --- 1063 return afs_wait_for_call_to_complete(call, &fc->ac); 1064} 1065 1066/* 1067 * Deliver reply data to a YFS.Link operation. 1068 */ 1069static int yfs_deliver_fs_link(struct afs_call *call) 1070{ |
1073 struct afs_vnode *dvnode = call->reply[0], *vnode = call->reply[1]; | 1071 struct afs_vnode *dvnode = call->dvnode, *vnode = call->xvnode; |
1074 const __be32 *bp; 1075 int ret; 1076 1077 _enter("{%u}", call->unmarshall); 1078 1079 ret = afs_transfer_reply(call); 1080 if (ret < 0) 1081 return ret; --- 45 unchanged lines hidden (view full) --- 1127 sizeof(struct yfs_xdr_YFSFid), 1128 sizeof(struct yfs_xdr_YFSFetchStatus) + 1129 sizeof(struct yfs_xdr_YFSFetchStatus) + 1130 sizeof(struct yfs_xdr_YFSVolSync)); 1131 if (!call) 1132 return -ENOMEM; 1133 1134 call->key = fc->key; | 1072 const __be32 *bp; 1073 int ret; 1074 1075 _enter("{%u}", call->unmarshall); 1076 1077 ret = afs_transfer_reply(call); 1078 if (ret < 0) 1079 return ret; --- 45 unchanged lines hidden (view full) --- 1125 sizeof(struct yfs_xdr_YFSFid), 1126 sizeof(struct yfs_xdr_YFSFetchStatus) + 1127 sizeof(struct yfs_xdr_YFSFetchStatus) + 1128 sizeof(struct yfs_xdr_YFSVolSync)); 1129 if (!call) 1130 return -ENOMEM; 1131 1132 call->key = fc->key; |
1135 call->reply[0] = dvnode; 1136 call->reply[1] = vnode; | 1133 call->dvnode = dvnode; 1134 call->xvnode = vnode; |
1137 call->expected_version = current_data_version + 1; 1138 1139 /* marshall the parameters */ 1140 bp = call->request; 1141 bp = xdr_encode_u32(bp, YFSLINK); 1142 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1143 bp = xdr_encode_YFSFid(bp, &dvnode->fid); 1144 bp = xdr_encode_string(bp, name, namesz); --- 7 unchanged lines hidden (view full) --- 1152 return afs_wait_for_call_to_complete(call, &fc->ac); 1153} 1154 1155/* 1156 * Deliver reply data to a YFS.Symlink operation. 1157 */ 1158static int yfs_deliver_fs_symlink(struct afs_call *call) 1159{ | 1135 call->expected_version = current_data_version + 1; 1136 1137 /* marshall the parameters */ 1138 bp = call->request; 1139 bp = xdr_encode_u32(bp, YFSLINK); 1140 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1141 bp = xdr_encode_YFSFid(bp, &dvnode->fid); 1142 bp = xdr_encode_string(bp, name, namesz); --- 7 unchanged lines hidden (view full) --- 1150 return afs_wait_for_call_to_complete(call, &fc->ac); 1151} 1152 1153/* 1154 * Deliver reply data to a YFS.Symlink operation. 1155 */ 1156static int yfs_deliver_fs_symlink(struct afs_call *call) 1157{ |
1160 struct afs_vnode *vnode = call->reply[0]; | 1158 struct afs_vnode *dvnode = call->dvnode; |
1161 const __be32 *bp; 1162 int ret; 1163 1164 _enter("{%u}", call->unmarshall); 1165 1166 ret = afs_transfer_reply(call); 1167 if (ret < 0) 1168 return ret; 1169 1170 /* unmarshall the reply once we've received all of it */ 1171 bp = call->buffer; | 1159 const __be32 *bp; 1160 int ret; 1161 1162 _enter("{%u}", call->unmarshall); 1163 1164 ret = afs_transfer_reply(call); 1165 if (ret < 0) 1166 return ret; 1167 1168 /* unmarshall the reply once we've received all of it */ 1169 bp = call->buffer; |
1172 xdr_decode_YFSFid(&bp, call->reply[1]); 1173 ret = yfs_decode_status(call, &bp, call->reply[2], NULL, NULL, NULL); | 1170 xdr_decode_YFSFid(&bp, call->out_fid); 1171 ret = yfs_decode_status(call, &bp, call->out_extra_status, NULL, NULL, NULL); |
1174 if (ret < 0) 1175 return ret; | 1172 if (ret < 0) 1173 return ret; |
1176 ret = yfs_decode_status(call, &bp, &vnode->status, vnode, | 1174 ret = yfs_decode_status(call, &bp, &dvnode->status, dvnode, |
1177 &call->expected_version, NULL); 1178 if (ret < 0) 1179 return ret; 1180 xdr_decode_YFSVolSync(&bp, NULL); 1181 1182 _leave(" = 0 [done]"); 1183 return 0; 1184} --- 38 unchanged lines hidden (view full) --- 1223 sizeof(struct yfs_xdr_YFSFid) + 1224 sizeof(struct yfs_xdr_YFSFetchStatus) + 1225 sizeof(struct yfs_xdr_YFSFetchStatus) + 1226 sizeof(struct yfs_xdr_YFSVolSync)); 1227 if (!call) 1228 return -ENOMEM; 1229 1230 call->key = fc->key; | 1175 &call->expected_version, NULL); 1176 if (ret < 0) 1177 return ret; 1178 xdr_decode_YFSVolSync(&bp, NULL); 1179 1180 _leave(" = 0 [done]"); 1181 return 0; 1182} --- 38 unchanged lines hidden (view full) --- 1221 sizeof(struct yfs_xdr_YFSFid) + 1222 sizeof(struct yfs_xdr_YFSFetchStatus) + 1223 sizeof(struct yfs_xdr_YFSFetchStatus) + 1224 sizeof(struct yfs_xdr_YFSVolSync)); 1225 if (!call) 1226 return -ENOMEM; 1227 1228 call->key = fc->key; |
1231 call->reply[0] = dvnode; 1232 call->reply[1] = newfid; 1233 call->reply[2] = newstatus; | 1229 call->dvnode = dvnode; 1230 call->out_fid = newfid; 1231 call->out_extra_status = newstatus; |
1234 call->expected_version = current_data_version + 1; 1235 1236 /* marshall the parameters */ 1237 bp = call->request; 1238 bp = xdr_encode_u32(bp, YFSSYMLINK); 1239 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1240 bp = xdr_encode_YFSFid(bp, &dvnode->fid); 1241 bp = xdr_encode_string(bp, name, namesz); --- 8 unchanged lines hidden (view full) --- 1250 return afs_wait_for_call_to_complete(call, &fc->ac); 1251} 1252 1253/* 1254 * Deliver reply data to a YFS.Rename operation. 1255 */ 1256static int yfs_deliver_fs_rename(struct afs_call *call) 1257{ | 1232 call->expected_version = current_data_version + 1; 1233 1234 /* marshall the parameters */ 1235 bp = call->request; 1236 bp = xdr_encode_u32(bp, YFSSYMLINK); 1237 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1238 bp = xdr_encode_YFSFid(bp, &dvnode->fid); 1239 bp = xdr_encode_string(bp, name, namesz); --- 8 unchanged lines hidden (view full) --- 1248 return afs_wait_for_call_to_complete(call, &fc->ac); 1249} 1250 1251/* 1252 * Deliver reply data to a YFS.Rename operation. 1253 */ 1254static int yfs_deliver_fs_rename(struct afs_call *call) 1255{ |
1258 struct afs_vnode *orig_dvnode = call->reply[0]; 1259 struct afs_vnode *new_dvnode = call->reply[1]; | 1256 struct afs_vnode *orig_dvnode = call->dvnode; 1257 struct afs_vnode *new_dvnode = call->xvnode; |
1260 const __be32 *bp; 1261 int ret; 1262 1263 _enter("{%u}", call->unmarshall); 1264 1265 ret = afs_transfer_reply(call); 1266 if (ret < 0) 1267 return ret; --- 55 unchanged lines hidden (view full) --- 1323 xdr_strlen(n_namesz), 1324 sizeof(struct yfs_xdr_YFSFetchStatus) + 1325 sizeof(struct yfs_xdr_YFSFetchStatus) + 1326 sizeof(struct yfs_xdr_YFSVolSync)); 1327 if (!call) 1328 return -ENOMEM; 1329 1330 call->key = fc->key; | 1258 const __be32 *bp; 1259 int ret; 1260 1261 _enter("{%u}", call->unmarshall); 1262 1263 ret = afs_transfer_reply(call); 1264 if (ret < 0) 1265 return ret; --- 55 unchanged lines hidden (view full) --- 1321 xdr_strlen(n_namesz), 1322 sizeof(struct yfs_xdr_YFSFetchStatus) + 1323 sizeof(struct yfs_xdr_YFSFetchStatus) + 1324 sizeof(struct yfs_xdr_YFSVolSync)); 1325 if (!call) 1326 return -ENOMEM; 1327 1328 call->key = fc->key; |
1331 call->reply[0] = orig_dvnode; 1332 call->reply[1] = new_dvnode; | 1329 call->dvnode = orig_dvnode; 1330 call->xvnode = new_dvnode; |
1333 call->expected_version = current_orig_data_version + 1; 1334 call->expected_version_2 = current_new_data_version + 1; 1335 1336 /* marshall the parameters */ 1337 bp = call->request; 1338 bp = xdr_encode_u32(bp, YFSRENAME); 1339 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1340 bp = xdr_encode_YFSFid(bp, &orig_dvnode->fid); --- 9 unchanged lines hidden (view full) --- 1350 return afs_wait_for_call_to_complete(call, &fc->ac); 1351} 1352 1353/* 1354 * Deliver reply data to a YFS.StoreData64 operation. 1355 */ 1356static int yfs_deliver_fs_store_data(struct afs_call *call) 1357{ | 1331 call->expected_version = current_orig_data_version + 1; 1332 call->expected_version_2 = current_new_data_version + 1; 1333 1334 /* marshall the parameters */ 1335 bp = call->request; 1336 bp = xdr_encode_u32(bp, YFSRENAME); 1337 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1338 bp = xdr_encode_YFSFid(bp, &orig_dvnode->fid); --- 9 unchanged lines hidden (view full) --- 1348 return afs_wait_for_call_to_complete(call, &fc->ac); 1349} 1350 1351/* 1352 * Deliver reply data to a YFS.StoreData64 operation. 1353 */ 1354static int yfs_deliver_fs_store_data(struct afs_call *call) 1355{ |
1358 struct afs_vnode *vnode = call->reply[0]; | 1356 struct afs_vnode *vnode = call->xvnode; |
1359 const __be32 *bp; 1360 int ret; 1361 1362 _enter(""); 1363 1364 ret = afs_transfer_reply(call); 1365 if (ret < 0) 1366 return ret; --- 60 unchanged lines hidden (view full) --- 1427 sizeof(struct yfs_xdr_u64) * 3, 1428 sizeof(struct yfs_xdr_YFSFetchStatus) + 1429 sizeof(struct yfs_xdr_YFSVolSync)); 1430 if (!call) 1431 return -ENOMEM; 1432 1433 call->key = fc->key; 1434 call->mapping = mapping; | 1357 const __be32 *bp; 1358 int ret; 1359 1360 _enter(""); 1361 1362 ret = afs_transfer_reply(call); 1363 if (ret < 0) 1364 return ret; --- 60 unchanged lines hidden (view full) --- 1425 sizeof(struct yfs_xdr_u64) * 3, 1426 sizeof(struct yfs_xdr_YFSFetchStatus) + 1427 sizeof(struct yfs_xdr_YFSVolSync)); 1428 if (!call) 1429 return -ENOMEM; 1430 1431 call->key = fc->key; 1432 call->mapping = mapping; |
1435 call->reply[0] = vnode; | 1433 call->xvnode = vnode; |
1436 call->first = first; 1437 call->last = last; 1438 call->first_offset = offset; 1439 call->last_to = to; 1440 call->send_pages = true; 1441 call->expected_version = vnode->status.data_version + 1; 1442 1443 /* marshall the parameters */ --- 14 unchanged lines hidden (view full) --- 1458 return afs_wait_for_call_to_complete(call, &fc->ac); 1459} 1460 1461/* 1462 * deliver reply data to an FS.StoreStatus 1463 */ 1464static int yfs_deliver_fs_store_status(struct afs_call *call) 1465{ | 1434 call->first = first; 1435 call->last = last; 1436 call->first_offset = offset; 1437 call->last_to = to; 1438 call->send_pages = true; 1439 call->expected_version = vnode->status.data_version + 1; 1440 1441 /* marshall the parameters */ --- 14 unchanged lines hidden (view full) --- 1456 return afs_wait_for_call_to_complete(call, &fc->ac); 1457} 1458 1459/* 1460 * deliver reply data to an FS.StoreStatus 1461 */ 1462static int yfs_deliver_fs_store_status(struct afs_call *call) 1463{ |
1466 struct afs_vnode *vnode = call->reply[0]; | 1464 struct afs_vnode *vnode = call->xvnode; |
1467 const __be32 *bp; 1468 int ret; 1469 1470 _enter(""); 1471 1472 ret = afs_transfer_reply(call); 1473 if (ret < 0) 1474 return ret; --- 47 unchanged lines hidden (view full) --- 1522 sizeof(struct yfs_xdr_YFSStoreStatus) + 1523 sizeof(struct yfs_xdr_u64) * 3, 1524 sizeof(struct yfs_xdr_YFSFetchStatus) + 1525 sizeof(struct yfs_xdr_YFSVolSync)); 1526 if (!call) 1527 return -ENOMEM; 1528 1529 call->key = fc->key; | 1465 const __be32 *bp; 1466 int ret; 1467 1468 _enter(""); 1469 1470 ret = afs_transfer_reply(call); 1471 if (ret < 0) 1472 return ret; --- 47 unchanged lines hidden (view full) --- 1520 sizeof(struct yfs_xdr_YFSStoreStatus) + 1521 sizeof(struct yfs_xdr_u64) * 3, 1522 sizeof(struct yfs_xdr_YFSFetchStatus) + 1523 sizeof(struct yfs_xdr_YFSVolSync)); 1524 if (!call) 1525 return -ENOMEM; 1526 1527 call->key = fc->key; |
1530 call->reply[0] = vnode; | 1528 call->xvnode = vnode; |
1531 call->expected_version = vnode->status.data_version + 1; 1532 1533 /* marshall the parameters */ 1534 bp = call->request; 1535 bp = xdr_encode_u32(bp, YFSSTOREDATA64); 1536 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1537 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1538 bp = xdr_encode_YFS_StoreStatus(bp, attr); --- 31 unchanged lines hidden (view full) --- 1570 sizeof(struct yfs_xdr_YFSFid) + 1571 sizeof(struct yfs_xdr_YFSStoreStatus), 1572 sizeof(struct yfs_xdr_YFSFetchStatus) + 1573 sizeof(struct yfs_xdr_YFSVolSync)); 1574 if (!call) 1575 return -ENOMEM; 1576 1577 call->key = fc->key; | 1529 call->expected_version = vnode->status.data_version + 1; 1530 1531 /* marshall the parameters */ 1532 bp = call->request; 1533 bp = xdr_encode_u32(bp, YFSSTOREDATA64); 1534 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1535 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1536 bp = xdr_encode_YFS_StoreStatus(bp, attr); --- 31 unchanged lines hidden (view full) --- 1568 sizeof(struct yfs_xdr_YFSFid) + 1569 sizeof(struct yfs_xdr_YFSStoreStatus), 1570 sizeof(struct yfs_xdr_YFSFetchStatus) + 1571 sizeof(struct yfs_xdr_YFSVolSync)); 1572 if (!call) 1573 return -ENOMEM; 1574 1575 call->key = fc->key; |
1578 call->reply[0] = vnode; | 1576 call->xvnode = vnode; |
1579 call->expected_version = vnode->status.data_version; 1580 1581 /* marshall the parameters */ 1582 bp = call->request; 1583 bp = xdr_encode_u32(bp, YFSSTORESTATUS); 1584 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1585 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1586 bp = xdr_encode_YFS_StoreStatus(bp, attr); --- 26 unchanged lines hidden (view full) --- 1613 /* Fall through - and extract the returned status record */ 1614 case 1: 1615 _debug("extract status"); 1616 ret = afs_extract_data(call, true); 1617 if (ret < 0) 1618 return ret; 1619 1620 bp = call->buffer; | 1577 call->expected_version = vnode->status.data_version; 1578 1579 /* marshall the parameters */ 1580 bp = call->request; 1581 bp = xdr_encode_u32(bp, YFSSTORESTATUS); 1582 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1583 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1584 bp = xdr_encode_YFS_StoreStatus(bp, attr); --- 26 unchanged lines hidden (view full) --- 1611 /* Fall through - and extract the returned status record */ 1612 case 1: 1613 _debug("extract status"); 1614 ret = afs_extract_data(call, true); 1615 if (ret < 0) 1616 return ret; 1617 1618 bp = call->buffer; |
1621 xdr_decode_YFSFetchVolumeStatus(&bp, call->reply[1]); | 1619 xdr_decode_YFSFetchVolumeStatus(&bp, call->out_volstatus); |
1622 call->unmarshall++; 1623 afs_extract_to_tmp(call); 1624 1625 /* Fall through - and extract the volume name length */ 1626 case 2: 1627 ret = afs_extract_data(call, true); 1628 if (ret < 0) 1629 return ret; 1630 1631 call->count = ntohl(call->tmp); 1632 _debug("volname length: %u", call->count); 1633 if (call->count >= AFSNAMEMAX) 1634 return afs_protocol_error(call, -EBADMSG, 1635 afs_eproto_volname_len); 1636 size = (call->count + 3) & ~3; /* It's padded */ | 1620 call->unmarshall++; 1621 afs_extract_to_tmp(call); 1622 1623 /* Fall through - and extract the volume name length */ 1624 case 2: 1625 ret = afs_extract_data(call, true); 1626 if (ret < 0) 1627 return ret; 1628 1629 call->count = ntohl(call->tmp); 1630 _debug("volname length: %u", call->count); 1631 if (call->count >= AFSNAMEMAX) 1632 return afs_protocol_error(call, -EBADMSG, 1633 afs_eproto_volname_len); 1634 size = (call->count + 3) & ~3; /* It's padded */ |
1637 afs_extract_begin(call, call->reply[2], size); | 1635 afs_extract_to_buf(call, size); |
1638 call->unmarshall++; 1639 1640 /* Fall through - and extract the volume name */ 1641 case 3: 1642 _debug("extract volname"); 1643 ret = afs_extract_data(call, true); 1644 if (ret < 0) 1645 return ret; 1646 | 1636 call->unmarshall++; 1637 1638 /* Fall through - and extract the volume name */ 1639 case 3: 1640 _debug("extract volname"); 1641 ret = afs_extract_data(call, true); 1642 if (ret < 0) 1643 return ret; 1644 |
1647 p = call->reply[2]; | 1645 p = call->buffer; |
1648 p[call->count] = 0; 1649 _debug("volname '%s'", p); 1650 afs_extract_to_tmp(call); 1651 call->unmarshall++; 1652 1653 /* Fall through - and extract the offline message length */ 1654 case 4: 1655 ret = afs_extract_data(call, true); 1656 if (ret < 0) 1657 return ret; 1658 1659 call->count = ntohl(call->tmp); 1660 _debug("offline msg length: %u", call->count); 1661 if (call->count >= AFSNAMEMAX) 1662 return afs_protocol_error(call, -EBADMSG, 1663 afs_eproto_offline_msg_len); 1664 size = (call->count + 3) & ~3; /* It's padded */ | 1646 p[call->count] = 0; 1647 _debug("volname '%s'", p); 1648 afs_extract_to_tmp(call); 1649 call->unmarshall++; 1650 1651 /* Fall through - and extract the offline message length */ 1652 case 4: 1653 ret = afs_extract_data(call, true); 1654 if (ret < 0) 1655 return ret; 1656 1657 call->count = ntohl(call->tmp); 1658 _debug("offline msg length: %u", call->count); 1659 if (call->count >= AFSNAMEMAX) 1660 return afs_protocol_error(call, -EBADMSG, 1661 afs_eproto_offline_msg_len); 1662 size = (call->count + 3) & ~3; /* It's padded */ |
1665 afs_extract_begin(call, call->reply[2], size); | 1663 afs_extract_to_buf(call, size); |
1666 call->unmarshall++; 1667 1668 /* Fall through - and extract the offline message */ 1669 case 5: 1670 _debug("extract offline"); 1671 ret = afs_extract_data(call, true); 1672 if (ret < 0) 1673 return ret; 1674 | 1664 call->unmarshall++; 1665 1666 /* Fall through - and extract the offline message */ 1667 case 5: 1668 _debug("extract offline"); 1669 ret = afs_extract_data(call, true); 1670 if (ret < 0) 1671 return ret; 1672 |
1675 p = call->reply[2]; | 1673 p = call->buffer; |
1676 p[call->count] = 0; 1677 _debug("offline '%s'", p); 1678 1679 afs_extract_to_tmp(call); 1680 call->unmarshall++; 1681 1682 /* Fall through - and extract the message of the day length */ 1683 case 6: 1684 ret = afs_extract_data(call, true); 1685 if (ret < 0) 1686 return ret; 1687 1688 call->count = ntohl(call->tmp); 1689 _debug("motd length: %u", call->count); 1690 if (call->count >= AFSNAMEMAX) 1691 return afs_protocol_error(call, -EBADMSG, 1692 afs_eproto_motd_len); 1693 size = (call->count + 3) & ~3; /* It's padded */ | 1674 p[call->count] = 0; 1675 _debug("offline '%s'", p); 1676 1677 afs_extract_to_tmp(call); 1678 call->unmarshall++; 1679 1680 /* Fall through - and extract the message of the day length */ 1681 case 6: 1682 ret = afs_extract_data(call, true); 1683 if (ret < 0) 1684 return ret; 1685 1686 call->count = ntohl(call->tmp); 1687 _debug("motd length: %u", call->count); 1688 if (call->count >= AFSNAMEMAX) 1689 return afs_protocol_error(call, -EBADMSG, 1690 afs_eproto_motd_len); 1691 size = (call->count + 3) & ~3; /* It's padded */ |
1694 afs_extract_begin(call, call->reply[2], size); | 1692 afs_extract_to_buf(call, size); |
1695 call->unmarshall++; 1696 1697 /* Fall through - and extract the message of the day */ 1698 case 7: 1699 _debug("extract motd"); 1700 ret = afs_extract_data(call, false); 1701 if (ret < 0) 1702 return ret; 1703 | 1693 call->unmarshall++; 1694 1695 /* Fall through - and extract the message of the day */ 1696 case 7: 1697 _debug("extract motd"); 1698 ret = afs_extract_data(call, false); 1699 if (ret < 0) 1700 return ret; 1701 |
1704 p = call->reply[2]; | 1702 p = call->buffer; |
1705 p[call->count] = 0; 1706 _debug("motd '%s'", p); 1707 1708 call->unmarshall++; 1709 1710 /* Fall through */ 1711 case 8: 1712 break; 1713 } 1714 1715 _leave(" = 0 [done]"); 1716 return 0; 1717} 1718 1719/* | 1703 p[call->count] = 0; 1704 _debug("motd '%s'", p); 1705 1706 call->unmarshall++; 1707 1708 /* Fall through */ 1709 case 8: 1710 break; 1711 } 1712 1713 _leave(" = 0 [done]"); 1714 return 0; 1715} 1716 1717/* |
1720 * Destroy a YFS.GetVolumeStatus call. 1721 */ 1722static void yfs_get_volume_status_call_destructor(struct afs_call *call) 1723{ 1724 kfree(call->reply[2]); 1725 call->reply[2] = NULL; 1726 afs_flat_call_destructor(call); 1727} 1728 1729/* | |
1730 * YFS.GetVolumeStatus operation type 1731 */ 1732static const struct afs_call_type yfs_RXYFSGetVolumeStatus = { 1733 .name = "YFS.GetVolumeStatus", 1734 .op = yfs_FS_GetVolumeStatus, 1735 .deliver = yfs_deliver_fs_get_volume_status, | 1718 * YFS.GetVolumeStatus operation type 1719 */ 1720static const struct afs_call_type yfs_RXYFSGetVolumeStatus = { 1721 .name = "YFS.GetVolumeStatus", 1722 .op = yfs_FS_GetVolumeStatus, 1723 .deliver = yfs_deliver_fs_get_volume_status, |
1736 .destructor = yfs_get_volume_status_call_destructor, | 1724 .destructor = afs_flat_call_destructor, |
1737}; 1738 1739/* 1740 * fetch the status of a volume 1741 */ 1742int yfs_fs_get_volume_status(struct afs_fs_cursor *fc, 1743 struct afs_volume_status *vs) 1744{ 1745 struct afs_vnode *vnode = fc->vnode; 1746 struct afs_call *call; 1747 struct afs_net *net = afs_v2net(vnode); 1748 __be32 *bp; | 1725}; 1726 1727/* 1728 * fetch the status of a volume 1729 */ 1730int yfs_fs_get_volume_status(struct afs_fs_cursor *fc, 1731 struct afs_volume_status *vs) 1732{ 1733 struct afs_vnode *vnode = fc->vnode; 1734 struct afs_call *call; 1735 struct afs_net *net = afs_v2net(vnode); 1736 __be32 *bp; |
1749 void *tmpbuf; | |
1750 1751 _enter(""); 1752 | 1737 1738 _enter(""); 1739 |
1753 tmpbuf = kmalloc(AFSOPAQUEMAX, GFP_KERNEL); 1754 if (!tmpbuf) 1755 return -ENOMEM; 1756 | |
1757 call = afs_alloc_flat_call(net, &yfs_RXYFSGetVolumeStatus, 1758 sizeof(__be32) * 2 + 1759 sizeof(struct yfs_xdr_u64), | 1740 call = afs_alloc_flat_call(net, &yfs_RXYFSGetVolumeStatus, 1741 sizeof(__be32) * 2 + 1742 sizeof(struct yfs_xdr_u64), |
1760 sizeof(struct yfs_xdr_YFSFetchVolumeStatus) + 1761 sizeof(__be32)); 1762 if (!call) { 1763 kfree(tmpbuf); | 1743 max_t(size_t, 1744 sizeof(struct yfs_xdr_YFSFetchVolumeStatus) + 1745 sizeof(__be32), 1746 AFSOPAQUEMAX + 1)); 1747 if (!call) |
1764 return -ENOMEM; | 1748 return -ENOMEM; |
1765 } | |
1766 1767 call->key = fc->key; | 1749 1750 call->key = fc->key; |
1768 call->reply[0] = vnode; 1769 call->reply[1] = vs; 1770 call->reply[2] = tmpbuf; | 1751 call->out_volstatus = vs; |
1771 1772 /* marshall the parameters */ 1773 bp = call->request; 1774 bp = xdr_encode_u32(bp, YFSGETVOLUMESTATUS); 1775 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1776 bp = xdr_encode_u64(bp, vnode->fid.vid); 1777 yfs_check_req(call, bp); 1778 --- 5 unchanged lines hidden (view full) --- 1784} 1785 1786/* 1787 * Deliver reply data to operations that just return a file status and a volume 1788 * sync record. 1789 */ 1790static int yfs_deliver_status_and_volsync(struct afs_call *call) 1791{ | 1752 1753 /* marshall the parameters */ 1754 bp = call->request; 1755 bp = xdr_encode_u32(bp, YFSGETVOLUMESTATUS); 1756 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1757 bp = xdr_encode_u64(bp, vnode->fid.vid); 1758 yfs_check_req(call, bp); 1759 --- 5 unchanged lines hidden (view full) --- 1765} 1766 1767/* 1768 * Deliver reply data to operations that just return a file status and a volume 1769 * sync record. 1770 */ 1771static int yfs_deliver_status_and_volsync(struct afs_call *call) 1772{ |
1792 struct afs_vnode *vnode = call->reply[0]; | 1773 struct afs_vnode *vnode = call->xvnode; |
1793 const __be32 *bp; 1794 int ret; 1795 1796 _enter("{%u}", call->unmarshall); 1797 1798 ret = afs_transfer_reply(call); 1799 if (ret < 0) 1800 return ret; --- 59 unchanged lines hidden (view full) --- 1860 sizeof(struct yfs_xdr_YFSFid) + 1861 sizeof(__be32), 1862 sizeof(struct yfs_xdr_YFSFetchStatus) + 1863 sizeof(struct yfs_xdr_YFSVolSync)); 1864 if (!call) 1865 return -ENOMEM; 1866 1867 call->key = fc->key; | 1774 const __be32 *bp; 1775 int ret; 1776 1777 _enter("{%u}", call->unmarshall); 1778 1779 ret = afs_transfer_reply(call); 1780 if (ret < 0) 1781 return ret; --- 59 unchanged lines hidden (view full) --- 1841 sizeof(struct yfs_xdr_YFSFid) + 1842 sizeof(__be32), 1843 sizeof(struct yfs_xdr_YFSFetchStatus) + 1844 sizeof(struct yfs_xdr_YFSVolSync)); 1845 if (!call) 1846 return -ENOMEM; 1847 1848 call->key = fc->key; |
1868 call->reply[0] = vnode; | 1849 call->xvnode = vnode; |
1869 call->want_reply_time = true; 1870 1871 /* marshall the parameters */ 1872 bp = call->request; 1873 bp = xdr_encode_u32(bp, YFSSETLOCK); 1874 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1875 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1876 bp = xdr_encode_u32(bp, type); --- 22 unchanged lines hidden (view full) --- 1899 sizeof(__be32) * 2 + 1900 sizeof(struct yfs_xdr_YFSFid), 1901 sizeof(struct yfs_xdr_YFSFetchStatus) + 1902 sizeof(struct yfs_xdr_YFSVolSync)); 1903 if (!call) 1904 return -ENOMEM; 1905 1906 call->key = fc->key; | 1850 call->want_reply_time = true; 1851 1852 /* marshall the parameters */ 1853 bp = call->request; 1854 bp = xdr_encode_u32(bp, YFSSETLOCK); 1855 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1856 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1857 bp = xdr_encode_u32(bp, type); --- 22 unchanged lines hidden (view full) --- 1880 sizeof(__be32) * 2 + 1881 sizeof(struct yfs_xdr_YFSFid), 1882 sizeof(struct yfs_xdr_YFSFetchStatus) + 1883 sizeof(struct yfs_xdr_YFSVolSync)); 1884 if (!call) 1885 return -ENOMEM; 1886 1887 call->key = fc->key; |
1907 call->reply[0] = vnode; | 1888 call->xvnode = vnode; |
1908 call->want_reply_time = true; 1909 1910 /* marshall the parameters */ 1911 bp = call->request; 1912 bp = xdr_encode_u32(bp, YFSEXTENDLOCK); 1913 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1914 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1915 yfs_check_req(call, bp); --- 21 unchanged lines hidden (view full) --- 1937 sizeof(__be32) * 2 + 1938 sizeof(struct yfs_xdr_YFSFid), 1939 sizeof(struct yfs_xdr_YFSFetchStatus) + 1940 sizeof(struct yfs_xdr_YFSVolSync)); 1941 if (!call) 1942 return -ENOMEM; 1943 1944 call->key = fc->key; | 1889 call->want_reply_time = true; 1890 1891 /* marshall the parameters */ 1892 bp = call->request; 1893 bp = xdr_encode_u32(bp, YFSEXTENDLOCK); 1894 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1895 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1896 yfs_check_req(call, bp); --- 21 unchanged lines hidden (view full) --- 1918 sizeof(__be32) * 2 + 1919 sizeof(struct yfs_xdr_YFSFid), 1920 sizeof(struct yfs_xdr_YFSFetchStatus) + 1921 sizeof(struct yfs_xdr_YFSVolSync)); 1922 if (!call) 1923 return -ENOMEM; 1924 1925 call->key = fc->key; |
1945 call->reply[0] = vnode; | 1926 call->xvnode = vnode; |
1946 1947 /* marshall the parameters */ 1948 bp = call->request; 1949 bp = xdr_encode_u32(bp, YFSRELEASELOCK); 1950 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1951 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1952 yfs_check_req(call, bp); 1953 --- 4 unchanged lines hidden (view full) --- 1958 return afs_wait_for_call_to_complete(call, &fc->ac); 1959} 1960 1961/* 1962 * Deliver reply data to an FS.FetchStatus with no vnode. 1963 */ 1964static int yfs_deliver_fs_fetch_status(struct afs_call *call) 1965{ | 1927 1928 /* marshall the parameters */ 1929 bp = call->request; 1930 bp = xdr_encode_u32(bp, YFSRELEASELOCK); 1931 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 1932 bp = xdr_encode_YFSFid(bp, &vnode->fid); 1933 yfs_check_req(call, bp); 1934 --- 4 unchanged lines hidden (view full) --- 1939 return afs_wait_for_call_to_complete(call, &fc->ac); 1940} 1941 1942/* 1943 * Deliver reply data to an FS.FetchStatus with no vnode. 1944 */ 1945static int yfs_deliver_fs_fetch_status(struct afs_call *call) 1946{ |
1966 struct afs_file_status *status = call->reply[1]; 1967 struct afs_callback *callback = call->reply[2]; 1968 struct afs_volsync *volsync = call->reply[3]; 1969 struct afs_vnode *vnode = call->reply[0]; | 1947 struct afs_file_status *status = call->out_extra_status; 1948 struct afs_callback *callback = call->out_cb; 1949 struct afs_volsync *volsync = call->out_volsync; |
1970 const __be32 *bp; 1971 int ret; 1972 1973 ret = afs_transfer_reply(call); 1974 if (ret < 0) 1975 return ret; 1976 | 1950 const __be32 *bp; 1951 int ret; 1952 1953 ret = afs_transfer_reply(call); 1954 if (ret < 0) 1955 return ret; 1956 |
1977 _enter("{%llx:%llu}", vnode->fid.vid, vnode->fid.vnode); | 1957 _enter(""); |
1978 1979 /* unmarshall the reply once we've received all of it */ 1980 bp = call->buffer; | 1958 1959 /* unmarshall the reply once we've received all of it */ 1960 bp = call->buffer; |
1981 ret = yfs_decode_status(call, &bp, status, vnode, | 1961 ret = yfs_decode_status(call, &bp, status, NULL, |
1982 &call->expected_version, NULL); 1983 if (ret < 0) 1984 return ret; 1985 xdr_decode_YFSCallBack_raw(call, callback, &bp); 1986 xdr_decode_YFSVolSync(&bp, volsync); 1987 1988 _leave(" = 0 [done]"); 1989 return 0; --- 32 unchanged lines hidden (view full) --- 2022 sizeof(struct yfs_xdr_YFSCallBack) + 2023 sizeof(struct yfs_xdr_YFSVolSync)); 2024 if (!call) { 2025 fc->ac.error = -ENOMEM; 2026 return -ENOMEM; 2027 } 2028 2029 call->key = fc->key; | 1962 &call->expected_version, NULL); 1963 if (ret < 0) 1964 return ret; 1965 xdr_decode_YFSCallBack_raw(call, callback, &bp); 1966 xdr_decode_YFSVolSync(&bp, volsync); 1967 1968 _leave(" = 0 [done]"); 1969 return 0; --- 32 unchanged lines hidden (view full) --- 2002 sizeof(struct yfs_xdr_YFSCallBack) + 2003 sizeof(struct yfs_xdr_YFSVolSync)); 2004 if (!call) { 2005 fc->ac.error = -ENOMEM; 2006 return -ENOMEM; 2007 } 2008 2009 call->key = fc->key; |
2030 call->reply[0] = NULL; /* vnode for fid[0] */ 2031 call->reply[1] = status; 2032 call->reply[2] = callback; 2033 call->reply[3] = volsync; | 2010 call->out_extra_status = status; 2011 call->out_cb = callback; 2012 call->out_volsync = volsync; |
2034 call->expected_version = 1; /* vnode->status.data_version */ 2035 2036 /* marshall the parameters */ 2037 bp = call->request; 2038 bp = xdr_encode_u32(bp, YFSFETCHSTATUS); 2039 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 2040 bp = xdr_encode_YFSFid(bp, fid); 2041 yfs_check_req(call, bp); --- 6 unchanged lines hidden (view full) --- 2048 return afs_wait_for_call_to_complete(call, &fc->ac); 2049} 2050 2051/* 2052 * Deliver reply data to an YFS.InlineBulkStatus call 2053 */ 2054static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) 2055{ | 2013 call->expected_version = 1; /* vnode->status.data_version */ 2014 2015 /* marshall the parameters */ 2016 bp = call->request; 2017 bp = xdr_encode_u32(bp, YFSFETCHSTATUS); 2018 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 2019 bp = xdr_encode_YFSFid(bp, fid); 2020 yfs_check_req(call, bp); --- 6 unchanged lines hidden (view full) --- 2027 return afs_wait_for_call_to_complete(call, &fc->ac); 2028} 2029 2030/* 2031 * Deliver reply data to an YFS.InlineBulkStatus call 2032 */ 2033static int yfs_deliver_fs_inline_bulk_status(struct afs_call *call) 2034{ |
2056 struct afs_file_status *statuses; 2057 struct afs_callback *callbacks; 2058 struct afs_vnode *vnode = call->reply[0]; | 2035 struct afs_status_cb *scb; |
2059 const __be32 *bp; 2060 u32 tmp; 2061 int ret; 2062 2063 _enter("{%u}", call->unmarshall); 2064 2065 switch (call->unmarshall) { 2066 case 0: --- 22 unchanged lines hidden (view full) --- 2089 /* Fall through */ 2090 case 2: 2091 _debug("extract status array %u", call->count); 2092 ret = afs_extract_data(call, true); 2093 if (ret < 0) 2094 return ret; 2095 2096 bp = call->buffer; | 2036 const __be32 *bp; 2037 u32 tmp; 2038 int ret; 2039 2040 _enter("{%u}", call->unmarshall); 2041 2042 switch (call->unmarshall) { 2043 case 0: --- 22 unchanged lines hidden (view full) --- 2066 /* Fall through */ 2067 case 2: 2068 _debug("extract status array %u", call->count); 2069 ret = afs_extract_data(call, true); 2070 if (ret < 0) 2071 return ret; 2072 2073 bp = call->buffer; |
2097 statuses = call->reply[1]; 2098 ret = yfs_decode_status(call, &bp, &statuses[call->count], 2099 call->count == 0 ? vnode : NULL, 2100 NULL, NULL); | 2074 scb = &call->out_scb[call->count]; 2075 ret = yfs_decode_status(call, &bp, &scb->status, 2076 NULL, NULL, NULL); |
2101 if (ret < 0) 2102 return ret; 2103 2104 call->count++; 2105 if (call->count < call->count2) 2106 goto more_counts; 2107 2108 call->count = 0; --- 22 unchanged lines hidden (view full) --- 2131 case 4: 2132 _debug("extract CB array"); 2133 ret = afs_extract_data(call, true); 2134 if (ret < 0) 2135 return ret; 2136 2137 _debug("unmarshall CB array"); 2138 bp = call->buffer; | 2077 if (ret < 0) 2078 return ret; 2079 2080 call->count++; 2081 if (call->count < call->count2) 2082 goto more_counts; 2083 2084 call->count = 0; --- 22 unchanged lines hidden (view full) --- 2107 case 4: 2108 _debug("extract CB array"); 2109 ret = afs_extract_data(call, true); 2110 if (ret < 0) 2111 return ret; 2112 2113 _debug("unmarshall CB array"); 2114 bp = call->buffer; |
2139 callbacks = call->reply[2]; 2140 xdr_decode_YFSCallBack_raw(call, &callbacks[call->count], &bp); 2141 statuses = call->reply[1]; 2142 if (call->count == 0 && vnode && statuses[0].abort_code == 0) { 2143 bp = call->buffer; 2144 xdr_decode_YFSCallBack(call, vnode, &bp); 2145 } | 2115 scb = &call->out_scb[call->count]; 2116 xdr_decode_YFSCallBack_raw(call, &scb->callback, &bp); 2117 scb->have_cb = true; |
2146 call->count++; 2147 if (call->count < call->count2) 2148 goto more_cbs; 2149 2150 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync)); 2151 call->unmarshall++; 2152 2153 /* Fall through */ 2154 case 5: 2155 ret = afs_extract_data(call, false); 2156 if (ret < 0) 2157 return ret; 2158 2159 bp = call->buffer; | 2118 call->count++; 2119 if (call->count < call->count2) 2120 goto more_cbs; 2121 2122 afs_extract_to_buf(call, sizeof(struct yfs_xdr_YFSVolSync)); 2123 call->unmarshall++; 2124 2125 /* Fall through */ 2126 case 5: 2127 ret = afs_extract_data(call, false); 2128 if (ret < 0) 2129 return ret; 2130 2131 bp = call->buffer; |
2160 xdr_decode_YFSVolSync(&bp, call->reply[3]); | 2132 xdr_decode_YFSVolSync(&bp, call->out_volsync); |
2161 2162 call->unmarshall++; 2163 2164 /* Fall through */ 2165 case 6: 2166 break; 2167 } 2168 --- 12 unchanged lines hidden (view full) --- 2181}; 2182 2183/* 2184 * Fetch the status information for up to 1024 files 2185 */ 2186int yfs_fs_inline_bulk_status(struct afs_fs_cursor *fc, 2187 struct afs_net *net, 2188 struct afs_fid *fids, | 2133 2134 call->unmarshall++; 2135 2136 /* Fall through */ 2137 case 6: 2138 break; 2139 } 2140 --- 12 unchanged lines hidden (view full) --- 2153}; 2154 2155/* 2156 * Fetch the status information for up to 1024 files 2157 */ 2158int yfs_fs_inline_bulk_status(struct afs_fs_cursor *fc, 2159 struct afs_net *net, 2160 struct afs_fid *fids, |
2189 struct afs_file_status *statuses, 2190 struct afs_callback *callbacks, | 2161 struct afs_status_cb *statuses, |
2191 unsigned int nr_fids, 2192 struct afs_volsync *volsync) 2193{ 2194 struct afs_call *call; 2195 __be32 *bp; 2196 int i; 2197 2198 _enter(",%x,{%llx:%llu},%u", --- 6 unchanged lines hidden (view full) --- 2205 sizeof(struct yfs_xdr_YFSFid) * nr_fids, 2206 sizeof(struct yfs_xdr_YFSFetchStatus)); 2207 if (!call) { 2208 fc->ac.error = -ENOMEM; 2209 return -ENOMEM; 2210 } 2211 2212 call->key = fc->key; | 2162 unsigned int nr_fids, 2163 struct afs_volsync *volsync) 2164{ 2165 struct afs_call *call; 2166 __be32 *bp; 2167 int i; 2168 2169 _enter(",%x,{%llx:%llu},%u", --- 6 unchanged lines hidden (view full) --- 2176 sizeof(struct yfs_xdr_YFSFid) * nr_fids, 2177 sizeof(struct yfs_xdr_YFSFetchStatus)); 2178 if (!call) { 2179 fc->ac.error = -ENOMEM; 2180 return -ENOMEM; 2181 } 2182 2183 call->key = fc->key; |
2213 call->reply[0] = NULL; /* vnode for fid[0] */ 2214 call->reply[1] = statuses; 2215 call->reply[2] = callbacks; 2216 call->reply[3] = volsync; | 2184 call->out_scb = statuses; 2185 call->out_volsync = volsync; |
2217 call->count2 = nr_fids; 2218 2219 /* marshall the parameters */ 2220 bp = call->request; 2221 bp = xdr_encode_u32(bp, YFSINLINEBULKSTATUS); 2222 bp = xdr_encode_u32(bp, 0); /* RPCFlags */ 2223 bp = xdr_encode_u32(bp, nr_fids); 2224 for (i = 0; i < nr_fids; i++) --- 8 unchanged lines hidden (view full) --- 2233 return afs_wait_for_call_to_complete(call, &fc->ac); 2234} 2235 2236/* 2237 * Deliver reply data to an YFS.FetchOpaqueACL. 2238 */ 2239static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) 2240{ | 2186 call->count2 = nr_fids; 2187 2188 /* marshall the parameters */ 2189 bp = call->request; 2190 bp = xdr_encode_u32(bp, YFSINLINEBULKSTATUS); 2191 bp = xdr_encode_u32(bp, 0); /* RPCFlags */ 2192 bp = xdr_encode_u32(bp, nr_fids); 2193 for (i = 0; i < nr_fids; i++) --- 8 unchanged lines hidden (view full) --- 2202 return afs_wait_for_call_to_complete(call, &fc->ac); 2203} 2204 2205/* 2206 * Deliver reply data to an YFS.FetchOpaqueACL. 2207 */ 2208static int yfs_deliver_fs_fetch_opaque_acl(struct afs_call *call) 2209{ |
2241 struct afs_volsync *volsync = call->reply[2]; 2242 struct afs_vnode *vnode = call->reply[1]; 2243 struct yfs_acl *yacl = call->reply[0]; | 2210 struct afs_volsync *volsync = call->out_volsync; 2211 struct afs_vnode *vnode = call->xvnode; 2212 struct yfs_acl *yacl = call->out_yacl; |
2244 struct afs_acl *acl; 2245 const __be32 *bp; 2246 unsigned int size; 2247 int ret; 2248 2249 _enter("{%u}", call->unmarshall); 2250 2251 switch (call->unmarshall) { --- 129 unchanged lines hidden (view full) --- 2381 sizeof(struct yfs_xdr_YFSFetchStatus) + 2382 sizeof(struct yfs_xdr_YFSVolSync)); 2383 if (!call) { 2384 fc->ac.error = -ENOMEM; 2385 return ERR_PTR(-ENOMEM); 2386 } 2387 2388 call->key = fc->key; | 2213 struct afs_acl *acl; 2214 const __be32 *bp; 2215 unsigned int size; 2216 int ret; 2217 2218 _enter("{%u}", call->unmarshall); 2219 2220 switch (call->unmarshall) { --- 129 unchanged lines hidden (view full) --- 2350 sizeof(struct yfs_xdr_YFSFetchStatus) + 2351 sizeof(struct yfs_xdr_YFSVolSync)); 2352 if (!call) { 2353 fc->ac.error = -ENOMEM; 2354 return ERR_PTR(-ENOMEM); 2355 } 2356 2357 call->key = fc->key; |
2389 call->reply[0] = yacl; 2390 call->reply[1] = vnode; 2391 call->reply[2] = NULL; /* volsync */ | 2358 call->out_yacl = yacl; 2359 call->xvnode = vnode; 2360 call->out_volsync = NULL; /* volsync */ |
2392 2393 /* marshall the parameters */ 2394 bp = call->request; 2395 bp = xdr_encode_u32(bp, YFSFETCHOPAQUEACL); 2396 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 2397 bp = xdr_encode_YFSFid(bp, &vnode->fid); 2398 yfs_check_req(call, bp); 2399 --- 36 unchanged lines hidden (view full) --- 2436 sizeof(struct yfs_xdr_YFSFetchStatus) + 2437 sizeof(struct yfs_xdr_YFSVolSync)); 2438 if (!call) { 2439 fc->ac.error = -ENOMEM; 2440 return -ENOMEM; 2441 } 2442 2443 call->key = fc->key; | 2361 2362 /* marshall the parameters */ 2363 bp = call->request; 2364 bp = xdr_encode_u32(bp, YFSFETCHOPAQUEACL); 2365 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 2366 bp = xdr_encode_YFSFid(bp, &vnode->fid); 2367 yfs_check_req(call, bp); 2368 --- 36 unchanged lines hidden (view full) --- 2405 sizeof(struct yfs_xdr_YFSFetchStatus) + 2406 sizeof(struct yfs_xdr_YFSVolSync)); 2407 if (!call) { 2408 fc->ac.error = -ENOMEM; 2409 return -ENOMEM; 2410 } 2411 2412 call->key = fc->key; |
2444 call->reply[0] = vnode; 2445 call->reply[2] = NULL; /* volsync */ | 2413 call->xvnode = vnode; 2414 call->out_volsync = NULL; |
2446 2447 /* marshall the parameters */ 2448 bp = call->request; 2449 bp = xdr_encode_u32(bp, YFSSTOREOPAQUEACL2); 2450 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 2451 bp = xdr_encode_YFSFid(bp, &vnode->fid); 2452 bp = xdr_encode_u32(bp, acl->size); 2453 memcpy(bp, acl->data, acl->size); 2454 if (acl->size != size) 2455 memset((void *)bp + acl->size, 0, size - acl->size); 2456 yfs_check_req(call, bp); 2457 2458 trace_afs_make_fs_call(call, &vnode->fid); 2459 afs_make_call(&fc->ac, call, GFP_KERNEL); 2460 return afs_wait_for_call_to_complete(call, &fc->ac); 2461} | 2415 2416 /* marshall the parameters */ 2417 bp = call->request; 2418 bp = xdr_encode_u32(bp, YFSSTOREOPAQUEACL2); 2419 bp = xdr_encode_u32(bp, 0); /* RPC flags */ 2420 bp = xdr_encode_YFSFid(bp, &vnode->fid); 2421 bp = xdr_encode_u32(bp, acl->size); 2422 memcpy(bp, acl->data, acl->size); 2423 if (acl->size != size) 2424 memset((void *)bp + acl->size, 0, size - acl->size); 2425 yfs_check_req(call, bp); 2426 2427 trace_afs_make_fs_call(call, &vnode->fid); 2428 afs_make_call(&fc->ac, call, GFP_KERNEL); 2429 return afs_wait_for_call_to_complete(call, &fc->ac); 2430} |