Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sunrpc: properly type pc_encode callbacks

Drop the resp argument as it can trivially be derived from the rqstp
argument. With that all functions now have the same prototype, and we
can remove the unsafe casting to kxdrproc_t.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>

+185 -170
+1 -1
fs/lockd/svc4proc.c
··· 497 497 #define PROC(name, xargt, xrest, argt, rest, respsize) \ 498 498 { .pc_func = nlm4svc_proc_##name, \ 499 499 .pc_decode = nlm4svc_decode_##xargt, \ 500 - .pc_encode = (kxdrproc_t) nlm4svc_encode_##xrest, \ 500 + .pc_encode = nlm4svc_encode_##xrest, \ 501 501 .pc_release = NULL, \ 502 502 .pc_argsize = sizeof(struct nlm_##argt), \ 503 503 .pc_ressize = sizeof(struct nlm_##rest), \
+1 -1
fs/lockd/svcproc.c
··· 539 539 #define PROC(name, xargt, xrest, argt, rest, respsize) \ 540 540 { .pc_func = nlmsvc_proc_##name, \ 541 541 .pc_decode = nlmsvc_decode_##xargt, \ 542 - .pc_encode = (kxdrproc_t) nlmsvc_encode_##xrest, \ 542 + .pc_encode = nlmsvc_encode_##xrest, \ 543 543 .pc_release = NULL, \ 544 544 .pc_argsize = sizeof(struct nlm_##argt), \ 545 545 .pc_ressize = sizeof(struct nlm_##rest), \
+10 -4
fs/lockd/xdr.c
··· 200 200 } 201 201 202 202 int 203 - nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) 203 + nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p) 204 204 { 205 + struct nlm_res *resp = rqstp->rq_resp; 206 + 205 207 if (!(p = nlm_encode_testres(p, resp))) 206 208 return 0; 207 209 return xdr_ressize_check(rqstp, p); ··· 282 280 } 283 281 284 282 int 285 - nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) 283 + nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p) 286 284 { 285 + struct nlm_res *resp = rqstp->rq_resp; 286 + 287 287 if (!(p = nlm_encode_cookie(p, &resp->cookie))) 288 288 return 0; 289 289 *p++ = resp->status; ··· 294 290 } 295 291 296 292 int 297 - nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) 293 + nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p) 298 294 { 295 + struct nlm_res *resp = rqstp->rq_resp; 296 + 299 297 if (!(p = nlm_encode_cookie(p, &resp->cookie))) 300 298 return 0; 301 299 *p++ = resp->status; ··· 348 342 } 349 343 350 344 int 351 - nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 345 + nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p) 352 346 { 353 347 return xdr_ressize_check(rqstp, p); 354 348 }
+10 -4
fs/lockd/xdr4.c
··· 197 197 } 198 198 199 199 int 200 - nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) 200 + nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p) 201 201 { 202 + struct nlm_res *resp = rqstp->rq_resp; 203 + 202 204 if (!(p = nlm4_encode_testres(p, resp))) 203 205 return 0; 204 206 return xdr_ressize_check(rqstp, p); ··· 279 277 } 280 278 281 279 int 282 - nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) 280 + nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p) 283 281 { 282 + struct nlm_res *resp = rqstp->rq_resp; 283 + 284 284 if (!(p = nlm4_encode_cookie(p, &resp->cookie))) 285 285 return 0; 286 286 *p++ = resp->status; ··· 291 287 } 292 288 293 289 int 294 - nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp) 290 + nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p) 295 291 { 292 + struct nlm_res *resp = rqstp->rq_resp; 293 + 296 294 if (!(p = nlm4_encode_cookie(p, &resp->cookie))) 297 295 return 0; 298 296 *p++ = resp->status; ··· 345 339 } 346 340 347 341 int 348 - nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 342 + nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p) 349 343 { 350 344 return xdr_ressize_check(rqstp, p); 351 345 }
+3 -3
fs/nfs/callback_xdr.c
··· 63 63 return xdr_argsize_check(rqstp, p); 64 64 } 65 65 66 - static int nfs4_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 66 + static int nfs4_encode_void(struct svc_rqst *rqstp, __be32 *p) 67 67 { 68 68 return xdr_ressize_check(rqstp, p); 69 69 } ··· 999 999 [CB_NULL] = { 1000 1000 .pc_func = nfs4_callback_null, 1001 1001 .pc_decode = nfs4_decode_void, 1002 - .pc_encode = (kxdrproc_t)nfs4_encode_void, 1002 + .pc_encode = nfs4_encode_void, 1003 1003 .pc_xdrressize = 1, 1004 1004 }, 1005 1005 [CB_COMPOUND] = { 1006 1006 .pc_func = nfs4_callback_compound, 1007 - .pc_encode = (kxdrproc_t)nfs4_encode_void, 1007 + .pc_encode = nfs4_encode_void, 1008 1008 .pc_argsize = 256, 1009 1009 .pc_ressize = 256, 1010 1010 .pc_xdrressize = NFS4_CALLBACK_BUFSIZE,
+10 -8
fs/nfsd/nfs2acl.c
··· 251 251 * There must be an encoding function for void results so svc_process 252 252 * will work properly. 253 253 */ 254 - static int nfsaclsvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) 254 + static int nfsaclsvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p) 255 255 { 256 256 return xdr_ressize_check(rqstp, p); 257 257 } 258 258 259 259 /* GETACL */ 260 - static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, 261 - struct nfsd3_getaclres *resp) 260 + static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p) 262 261 { 262 + struct nfsd3_getaclres *resp = rqstp->rq_resp; 263 263 struct dentry *dentry = resp->fh.fh_dentry; 264 264 struct inode *inode; 265 265 struct kvec *head = rqstp->rq_res.head; ··· 302 302 return (n > 0); 303 303 } 304 304 305 - static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p, 306 - struct nfsd_attrstat *resp) 305 + static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p) 307 306 { 307 + struct nfsd_attrstat *resp = rqstp->rq_resp; 308 + 308 309 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat); 309 310 return xdr_ressize_check(rqstp, p); 310 311 } 311 312 312 313 /* ACCESS */ 313 - static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p, 314 - struct nfsd3_accessres *resp) 314 + static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p) 315 315 { 316 + struct nfsd3_accessres *resp = rqstp->rq_resp; 317 + 316 318 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat); 317 319 *p++ = htonl(resp->access); 318 320 return xdr_ressize_check(rqstp, p); ··· 357 355 { \ 358 356 .pc_func = nfsacld_proc_##name, \ 359 357 .pc_decode = nfsaclsvc_decode_##argt##args, \ 360 - .pc_encode = (kxdrproc_t) nfsaclsvc_encode_##rest##res, \ 358 + .pc_encode = nfsaclsvc_encode_##rest##res, \ 361 359 .pc_release = nfsaclsvc_release_##relt, \ 362 360 .pc_argsize = sizeof(struct nfsd3_##argt##args), \ 363 361 .pc_ressize = sizeof(struct nfsd3_##rest##res), \
+6 -5
fs/nfsd/nfs3acl.c
··· 168 168 */ 169 169 170 170 /* GETACL */ 171 - static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p, 172 - struct nfsd3_getaclres *resp) 171 + static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p) 173 172 { 173 + struct nfsd3_getaclres *resp = rqstp->rq_resp; 174 174 struct dentry *dentry = resp->fh.fh_dentry; 175 175 176 176 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); ··· 213 213 } 214 214 215 215 /* SETACL */ 216 - static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p, 217 - struct nfsd3_attrstat *resp) 216 + static int nfs3svc_encode_setaclres(struct svc_rqst *rqstp, __be32 *p) 218 217 { 218 + struct nfsd3_attrstat *resp = rqstp->rq_resp; 219 + 219 220 p = nfs3svc_encode_post_op_attr(rqstp, p, &resp->fh); 220 221 221 222 return xdr_ressize_check(rqstp, p); ··· 244 243 { \ 245 244 .pc_func = nfsd3_proc_##name, \ 246 245 .pc_decode = nfs3svc_decode_##argt##args, \ 247 - .pc_encode = (kxdrproc_t) nfs3svc_encode_##rest##res, \ 246 + .pc_encode = nfs3svc_encode_##rest##res, \ 248 247 .pc_release = nfs3svc_release_##relt, \ 249 248 .pc_argsize = sizeof(struct nfsd3_##argt##args), \ 250 249 .pc_ressize = sizeof(struct nfsd3_##rest##res), \
+22 -22
fs/nfsd/nfs3proc.c
··· 677 677 static struct svc_procedure nfsd_procedures3[22] = { 678 678 [NFS3PROC_NULL] = { 679 679 .pc_func = nfsd3_proc_null, 680 - .pc_encode = (kxdrproc_t) nfs3svc_encode_voidres, 680 + .pc_encode = nfs3svc_encode_voidres, 681 681 .pc_argsize = sizeof(struct nfsd3_voidargs), 682 682 .pc_ressize = sizeof(struct nfsd3_voidres), 683 683 .pc_cachetype = RC_NOCACHE, ··· 686 686 [NFS3PROC_GETATTR] = { 687 687 .pc_func = nfsd3_proc_getattr, 688 688 .pc_decode = nfs3svc_decode_fhandleargs, 689 - .pc_encode = (kxdrproc_t) nfs3svc_encode_attrstatres, 689 + .pc_encode = nfs3svc_encode_attrstatres, 690 690 .pc_release = nfs3svc_release_fhandle, 691 691 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 692 692 .pc_ressize = sizeof(struct nfsd3_attrstatres), ··· 696 696 [NFS3PROC_SETATTR] = { 697 697 .pc_func = nfsd3_proc_setattr, 698 698 .pc_decode = nfs3svc_decode_sattrargs, 699 - .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 699 + .pc_encode = nfs3svc_encode_wccstatres, 700 700 .pc_release = nfs3svc_release_fhandle, 701 701 .pc_argsize = sizeof(struct nfsd3_sattrargs), 702 702 .pc_ressize = sizeof(struct nfsd3_wccstatres), ··· 706 706 [NFS3PROC_LOOKUP] = { 707 707 .pc_func = nfsd3_proc_lookup, 708 708 .pc_decode = nfs3svc_decode_diropargs, 709 - .pc_encode = (kxdrproc_t) nfs3svc_encode_diropres, 709 + .pc_encode = nfs3svc_encode_diropres, 710 710 .pc_release = nfs3svc_release_fhandle2, 711 711 .pc_argsize = sizeof(struct nfsd3_diropargs), 712 712 .pc_ressize = sizeof(struct nfsd3_diropres), ··· 716 716 [NFS3PROC_ACCESS] = { 717 717 .pc_func = nfsd3_proc_access, 718 718 .pc_decode = nfs3svc_decode_accessargs, 719 - .pc_encode = (kxdrproc_t) nfs3svc_encode_accessres, 719 + .pc_encode = nfs3svc_encode_accessres, 720 720 .pc_release = nfs3svc_release_fhandle, 721 721 .pc_argsize = sizeof(struct nfsd3_accessargs), 722 722 .pc_ressize = sizeof(struct nfsd3_accessres), ··· 726 726 [NFS3PROC_READLINK] = { 727 727 .pc_func = nfsd3_proc_readlink, 728 728 .pc_decode = nfs3svc_decode_readlinkargs, 729 - .pc_encode = (kxdrproc_t) nfs3svc_encode_readlinkres, 729 + .pc_encode = nfs3svc_encode_readlinkres, 730 730 .pc_release = nfs3svc_release_fhandle, 731 731 .pc_argsize = sizeof(struct nfsd3_readlinkargs), 732 732 .pc_ressize = sizeof(struct nfsd3_readlinkres), ··· 736 736 [NFS3PROC_READ] = { 737 737 .pc_func = nfsd3_proc_read, 738 738 .pc_decode = nfs3svc_decode_readargs, 739 - .pc_encode = (kxdrproc_t) nfs3svc_encode_readres, 739 + .pc_encode = nfs3svc_encode_readres, 740 740 .pc_release = nfs3svc_release_fhandle, 741 741 .pc_argsize = sizeof(struct nfsd3_readargs), 742 742 .pc_ressize = sizeof(struct nfsd3_readres), ··· 746 746 [NFS3PROC_WRITE] = { 747 747 .pc_func = nfsd3_proc_write, 748 748 .pc_decode = nfs3svc_decode_writeargs, 749 - .pc_encode = (kxdrproc_t) nfs3svc_encode_writeres, 749 + .pc_encode = nfs3svc_encode_writeres, 750 750 .pc_release = nfs3svc_release_fhandle, 751 751 .pc_argsize = sizeof(struct nfsd3_writeargs), 752 752 .pc_ressize = sizeof(struct nfsd3_writeres), ··· 756 756 [NFS3PROC_CREATE] = { 757 757 .pc_func = nfsd3_proc_create, 758 758 .pc_decode = nfs3svc_decode_createargs, 759 - .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 759 + .pc_encode = nfs3svc_encode_createres, 760 760 .pc_release = nfs3svc_release_fhandle2, 761 761 .pc_argsize = sizeof(struct nfsd3_createargs), 762 762 .pc_ressize = sizeof(struct nfsd3_createres), ··· 766 766 [NFS3PROC_MKDIR] = { 767 767 .pc_func = nfsd3_proc_mkdir, 768 768 .pc_decode = nfs3svc_decode_mkdirargs, 769 - .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 769 + .pc_encode = nfs3svc_encode_createres, 770 770 .pc_release = nfs3svc_release_fhandle2, 771 771 .pc_argsize = sizeof(struct nfsd3_mkdirargs), 772 772 .pc_ressize = sizeof(struct nfsd3_createres), ··· 776 776 [NFS3PROC_SYMLINK] = { 777 777 .pc_func = nfsd3_proc_symlink, 778 778 .pc_decode = nfs3svc_decode_symlinkargs, 779 - .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 779 + .pc_encode = nfs3svc_encode_createres, 780 780 .pc_release = nfs3svc_release_fhandle2, 781 781 .pc_argsize = sizeof(struct nfsd3_symlinkargs), 782 782 .pc_ressize = sizeof(struct nfsd3_createres), ··· 786 786 [NFS3PROC_MKNOD] = { 787 787 .pc_func = nfsd3_proc_mknod, 788 788 .pc_decode = nfs3svc_decode_mknodargs, 789 - .pc_encode = (kxdrproc_t) nfs3svc_encode_createres, 789 + .pc_encode = nfs3svc_encode_createres, 790 790 .pc_release = nfs3svc_release_fhandle2, 791 791 .pc_argsize = sizeof(struct nfsd3_mknodargs), 792 792 .pc_ressize = sizeof(struct nfsd3_createres), ··· 796 796 [NFS3PROC_REMOVE] = { 797 797 .pc_func = nfsd3_proc_remove, 798 798 .pc_decode = nfs3svc_decode_diropargs, 799 - .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 799 + .pc_encode = nfs3svc_encode_wccstatres, 800 800 .pc_release = nfs3svc_release_fhandle, 801 801 .pc_argsize = sizeof(struct nfsd3_diropargs), 802 802 .pc_ressize = sizeof(struct nfsd3_wccstatres), ··· 806 806 [NFS3PROC_RMDIR] = { 807 807 .pc_func = nfsd3_proc_rmdir, 808 808 .pc_decode = nfs3svc_decode_diropargs, 809 - .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres, 809 + .pc_encode = nfs3svc_encode_wccstatres, 810 810 .pc_release = nfs3svc_release_fhandle, 811 811 .pc_argsize = sizeof(struct nfsd3_diropargs), 812 812 .pc_ressize = sizeof(struct nfsd3_wccstatres), ··· 816 816 [NFS3PROC_RENAME] = { 817 817 .pc_func = nfsd3_proc_rename, 818 818 .pc_decode = nfs3svc_decode_renameargs, 819 - .pc_encode = (kxdrproc_t) nfs3svc_encode_renameres, 819 + .pc_encode = nfs3svc_encode_renameres, 820 820 .pc_release = nfs3svc_release_fhandle2, 821 821 .pc_argsize = sizeof(struct nfsd3_renameargs), 822 822 .pc_ressize = sizeof(struct nfsd3_renameres), ··· 826 826 [NFS3PROC_LINK] = { 827 827 .pc_func = nfsd3_proc_link, 828 828 .pc_decode = nfs3svc_decode_linkargs, 829 - .pc_encode = (kxdrproc_t) nfs3svc_encode_linkres, 829 + .pc_encode = nfs3svc_encode_linkres, 830 830 .pc_release = nfs3svc_release_fhandle2, 831 831 .pc_argsize = sizeof(struct nfsd3_linkargs), 832 832 .pc_ressize = sizeof(struct nfsd3_linkres), ··· 836 836 [NFS3PROC_READDIR] = { 837 837 .pc_func = nfsd3_proc_readdir, 838 838 .pc_decode = nfs3svc_decode_readdirargs, 839 - .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres, 839 + .pc_encode = nfs3svc_encode_readdirres, 840 840 .pc_release = nfs3svc_release_fhandle, 841 841 .pc_argsize = sizeof(struct nfsd3_readdirargs), 842 842 .pc_ressize = sizeof(struct nfsd3_readdirres), ··· 845 845 [NFS3PROC_READDIRPLUS] = { 846 846 .pc_func = nfsd3_proc_readdirplus, 847 847 .pc_decode = nfs3svc_decode_readdirplusargs, 848 - .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres, 848 + .pc_encode = nfs3svc_encode_readdirres, 849 849 .pc_release = nfs3svc_release_fhandle, 850 850 .pc_argsize = sizeof(struct nfsd3_readdirplusargs), 851 851 .pc_ressize = sizeof(struct nfsd3_readdirres), ··· 854 854 [NFS3PROC_FSSTAT] = { 855 855 .pc_func = nfsd3_proc_fsstat, 856 856 .pc_decode = nfs3svc_decode_fhandleargs, 857 - .pc_encode = (kxdrproc_t) nfs3svc_encode_fsstatres, 857 + .pc_encode = nfs3svc_encode_fsstatres, 858 858 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 859 859 .pc_ressize = sizeof(struct nfsd3_fsstatres), 860 860 .pc_cachetype = RC_NOCACHE, ··· 863 863 [NFS3PROC_FSINFO] = { 864 864 .pc_func = nfsd3_proc_fsinfo, 865 865 .pc_decode = nfs3svc_decode_fhandleargs, 866 - .pc_encode = (kxdrproc_t) nfs3svc_encode_fsinfores, 866 + .pc_encode = nfs3svc_encode_fsinfores, 867 867 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 868 868 .pc_ressize = sizeof(struct nfsd3_fsinfores), 869 869 .pc_cachetype = RC_NOCACHE, ··· 872 872 [NFS3PROC_PATHCONF] = { 873 873 .pc_func = nfsd3_proc_pathconf, 874 874 .pc_decode = nfs3svc_decode_fhandleargs, 875 - .pc_encode = (kxdrproc_t) nfs3svc_encode_pathconfres, 875 + .pc_encode = nfs3svc_encode_pathconfres, 876 876 .pc_argsize = sizeof(struct nfsd3_fhandleargs), 877 877 .pc_ressize = sizeof(struct nfsd3_pathconfres), 878 878 .pc_cachetype = RC_NOCACHE, ··· 881 881 [NFS3PROC_COMMIT] = { 882 882 .pc_func = nfsd3_proc_commit, 883 883 .pc_decode = nfs3svc_decode_commitargs, 884 - .pc_encode = (kxdrproc_t) nfs3svc_encode_commitres, 884 + .pc_encode = nfs3svc_encode_commitres, 885 885 .pc_release = nfs3svc_release_fhandle, 886 886 .pc_argsize = sizeof(struct nfsd3_commitargs), 887 887 .pc_ressize = sizeof(struct nfsd3_commitres),
+43 -31
fs/nfsd/nfs3xdr.c
··· 645 645 * will work properly. 646 646 */ 647 647 int 648 - nfs3svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) 648 + nfs3svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p) 649 649 { 650 650 return xdr_ressize_check(rqstp, p); 651 651 } 652 652 653 653 /* GETATTR */ 654 654 int 655 - nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, 656 - struct nfsd3_attrstat *resp) 655 + nfs3svc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p) 657 656 { 657 + struct nfsd3_attrstat *resp = rqstp->rq_resp; 658 + 658 659 if (resp->status == 0) { 659 660 lease_get_mtime(d_inode(resp->fh.fh_dentry), 660 661 &resp->stat.mtime); ··· 666 665 667 666 /* SETATTR, REMOVE, RMDIR */ 668 667 int 669 - nfs3svc_encode_wccstat(struct svc_rqst *rqstp, __be32 *p, 670 - struct nfsd3_attrstat *resp) 668 + nfs3svc_encode_wccstat(struct svc_rqst *rqstp, __be32 *p) 671 669 { 670 + struct nfsd3_attrstat *resp = rqstp->rq_resp; 671 + 672 672 p = encode_wcc_data(rqstp, p, &resp->fh); 673 673 return xdr_ressize_check(rqstp, p); 674 674 } 675 675 676 676 /* LOOKUP */ 677 677 int 678 - nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, 679 - struct nfsd3_diropres *resp) 678 + nfs3svc_encode_diropres(struct svc_rqst *rqstp, __be32 *p) 680 679 { 680 + struct nfsd3_diropres *resp = rqstp->rq_resp; 681 + 681 682 if (resp->status == 0) { 682 683 p = encode_fh(p, &resp->fh); 683 684 p = encode_post_op_attr(rqstp, p, &resp->fh); ··· 690 687 691 688 /* ACCESS */ 692 689 int 693 - nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p, 694 - struct nfsd3_accessres *resp) 690 + nfs3svc_encode_accessres(struct svc_rqst *rqstp, __be32 *p) 695 691 { 692 + struct nfsd3_accessres *resp = rqstp->rq_resp; 693 + 696 694 p = encode_post_op_attr(rqstp, p, &resp->fh); 697 695 if (resp->status == 0) 698 696 *p++ = htonl(resp->access); ··· 702 698 703 699 /* READLINK */ 704 700 int 705 - nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, 706 - struct nfsd3_readlinkres *resp) 701 + nfs3svc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p) 707 702 { 703 + struct nfsd3_readlinkres *resp = rqstp->rq_resp; 704 + 708 705 p = encode_post_op_attr(rqstp, p, &resp->fh); 709 706 if (resp->status == 0) { 710 707 *p++ = htonl(resp->len); ··· 724 719 725 720 /* READ */ 726 721 int 727 - nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p, 728 - struct nfsd3_readres *resp) 722 + nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p) 729 723 { 724 + struct nfsd3_readres *resp = rqstp->rq_resp; 725 + 730 726 p = encode_post_op_attr(rqstp, p, &resp->fh); 731 727 if (resp->status == 0) { 732 728 *p++ = htonl(resp->count); ··· 749 743 750 744 /* WRITE */ 751 745 int 752 - nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p, 753 - struct nfsd3_writeres *resp) 746 + nfs3svc_encode_writeres(struct svc_rqst *rqstp, __be32 *p) 754 747 { 748 + struct nfsd3_writeres *resp = rqstp->rq_resp; 755 749 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 756 750 757 751 p = encode_wcc_data(rqstp, p, &resp->fh); ··· 766 760 767 761 /* CREATE, MKDIR, SYMLINK, MKNOD */ 768 762 int 769 - nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p, 770 - struct nfsd3_diropres *resp) 763 + nfs3svc_encode_createres(struct svc_rqst *rqstp, __be32 *p) 771 764 { 765 + struct nfsd3_diropres *resp = rqstp->rq_resp; 766 + 772 767 if (resp->status == 0) { 773 768 *p++ = xdr_one; 774 769 p = encode_fh(p, &resp->fh); ··· 781 774 782 775 /* RENAME */ 783 776 int 784 - nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p, 785 - struct nfsd3_renameres *resp) 777 + nfs3svc_encode_renameres(struct svc_rqst *rqstp, __be32 *p) 786 778 { 779 + struct nfsd3_renameres *resp = rqstp->rq_resp; 780 + 787 781 p = encode_wcc_data(rqstp, p, &resp->ffh); 788 782 p = encode_wcc_data(rqstp, p, &resp->tfh); 789 783 return xdr_ressize_check(rqstp, p); ··· 792 784 793 785 /* LINK */ 794 786 int 795 - nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p, 796 - struct nfsd3_linkres *resp) 787 + nfs3svc_encode_linkres(struct svc_rqst *rqstp, __be32 *p) 797 788 { 789 + struct nfsd3_linkres *resp = rqstp->rq_resp; 790 + 798 791 p = encode_post_op_attr(rqstp, p, &resp->fh); 799 792 p = encode_wcc_data(rqstp, p, &resp->tfh); 800 793 return xdr_ressize_check(rqstp, p); ··· 803 794 804 795 /* READDIR */ 805 796 int 806 - nfs3svc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, 807 - struct nfsd3_readdirres *resp) 797 + nfs3svc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p) 808 798 { 799 + struct nfsd3_readdirres *resp = rqstp->rq_resp; 800 + 809 801 p = encode_post_op_attr(rqstp, p, &resp->fh); 810 802 811 803 if (resp->status == 0) { ··· 1054 1044 1055 1045 /* FSSTAT */ 1056 1046 int 1057 - nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p, 1058 - struct nfsd3_fsstatres *resp) 1047 + nfs3svc_encode_fsstatres(struct svc_rqst *rqstp, __be32 *p) 1059 1048 { 1049 + struct nfsd3_fsstatres *resp = rqstp->rq_resp; 1060 1050 struct kstatfs *s = &resp->stats; 1061 1051 u64 bs = s->f_bsize; 1062 1052 ··· 1076 1066 1077 1067 /* FSINFO */ 1078 1068 int 1079 - nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p, 1080 - struct nfsd3_fsinfores *resp) 1069 + nfs3svc_encode_fsinfores(struct svc_rqst *rqstp, __be32 *p) 1081 1070 { 1071 + struct nfsd3_fsinfores *resp = rqstp->rq_resp; 1072 + 1082 1073 *p++ = xdr_zero; /* no post_op_attr */ 1083 1074 1084 1075 if (resp->status == 0) { ··· 1101 1090 1102 1091 /* PATHCONF */ 1103 1092 int 1104 - nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p, 1105 - struct nfsd3_pathconfres *resp) 1093 + nfs3svc_encode_pathconfres(struct svc_rqst *rqstp, __be32 *p) 1106 1094 { 1095 + struct nfsd3_pathconfres *resp = rqstp->rq_resp; 1096 + 1107 1097 *p++ = xdr_zero; /* no post_op_attr */ 1108 1098 1109 1099 if (resp->status == 0) { ··· 1121 1109 1122 1110 /* COMMIT */ 1123 1111 int 1124 - nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p, 1125 - struct nfsd3_commitres *resp) 1112 + nfs3svc_encode_commitres(struct svc_rqst *rqstp, __be32 *p) 1126 1113 { 1114 + struct nfsd3_commitres *resp = rqstp->rq_resp; 1127 1115 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 1128 1116 1129 1117 p = encode_wcc_data(rqstp, p, &resp->fh);
+2 -2
fs/nfsd/nfs4proc.c
··· 2520 2520 static struct svc_procedure nfsd_procedures4[2] = { 2521 2521 [NFSPROC4_NULL] = { 2522 2522 .pc_func = nfsd4_proc_null, 2523 - .pc_encode = (kxdrproc_t) nfs4svc_encode_voidres, 2523 + .pc_encode = nfs4svc_encode_voidres, 2524 2524 .pc_argsize = sizeof(struct nfsd4_voidargs), 2525 2525 .pc_ressize = sizeof(struct nfsd4_voidres), 2526 2526 .pc_cachetype = RC_NOCACHE, ··· 2529 2529 [NFSPROC4_COMPOUND] = { 2530 2530 .pc_func = nfsd4_proc_compound, 2531 2531 .pc_decode = nfs4svc_decode_compoundargs, 2532 - .pc_encode = (kxdrproc_t) nfs4svc_encode_compoundres, 2532 + .pc_encode = nfs4svc_encode_compoundres, 2533 2533 .pc_argsize = sizeof(struct nfsd4_compoundargs), 2534 2534 .pc_ressize = sizeof(struct nfsd4_compoundres), 2535 2535 .pc_release = nfsd4_release_compoundargs,
+3 -2
fs/nfsd/nfs4xdr.c
··· 4538 4538 } 4539 4539 4540 4540 int 4541 - nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy) 4541 + nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p) 4542 4542 { 4543 4543 return xdr_ressize_check(rqstp, p); 4544 4544 } ··· 4584 4584 } 4585 4585 4586 4586 int 4587 - nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundres *resp) 4587 + nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p) 4588 4588 { 4589 4589 /* 4590 4590 * All that remains is to write the tag and operation count... 4591 4591 */ 4592 + struct nfsd4_compoundres *resp = rqstp->rq_resp; 4592 4593 struct xdr_buf *buf = resp->xdr.buf; 4593 4594 4594 4595 WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len +
+18 -18
fs/nfsd/nfsproc.c
··· 577 577 [NFSPROC_NULL] = { 578 578 .pc_func = nfsd_proc_null, 579 579 .pc_decode = nfssvc_decode_void, 580 - .pc_encode = (kxdrproc_t) nfssvc_encode_void, 580 + .pc_encode = nfssvc_encode_void, 581 581 .pc_argsize = sizeof(struct nfsd_void), 582 582 .pc_ressize = sizeof(struct nfsd_void), 583 583 .pc_cachetype = RC_NOCACHE, ··· 586 586 [NFSPROC_GETATTR] = { 587 587 .pc_func = nfsd_proc_getattr, 588 588 .pc_decode = nfssvc_decode_fhandle, 589 - .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 589 + .pc_encode = nfssvc_encode_attrstat, 590 590 .pc_release = nfssvc_release_fhandle, 591 591 .pc_argsize = sizeof(struct nfsd_fhandle), 592 592 .pc_ressize = sizeof(struct nfsd_attrstat), ··· 596 596 [NFSPROC_SETATTR] = { 597 597 .pc_func = nfsd_proc_setattr, 598 598 .pc_decode = nfssvc_decode_sattrargs, 599 - .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 599 + .pc_encode = nfssvc_encode_attrstat, 600 600 .pc_release = nfssvc_release_fhandle, 601 601 .pc_argsize = sizeof(struct nfsd_sattrargs), 602 602 .pc_ressize = sizeof(struct nfsd_attrstat), ··· 605 605 }, 606 606 [NFSPROC_ROOT] = { 607 607 .pc_decode = nfssvc_decode_void, 608 - .pc_encode = (kxdrproc_t) nfssvc_encode_void, 608 + .pc_encode = nfssvc_encode_void, 609 609 .pc_argsize = sizeof(struct nfsd_void), 610 610 .pc_ressize = sizeof(struct nfsd_void), 611 611 .pc_cachetype = RC_NOCACHE, ··· 614 614 [NFSPROC_LOOKUP] = { 615 615 .pc_func = nfsd_proc_lookup, 616 616 .pc_decode = nfssvc_decode_diropargs, 617 - .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 617 + .pc_encode = nfssvc_encode_diropres, 618 618 .pc_release = nfssvc_release_fhandle, 619 619 .pc_argsize = sizeof(struct nfsd_diropargs), 620 620 .pc_ressize = sizeof(struct nfsd_diropres), ··· 624 624 [NFSPROC_READLINK] = { 625 625 .pc_func = nfsd_proc_readlink, 626 626 .pc_decode = nfssvc_decode_readlinkargs, 627 - .pc_encode = (kxdrproc_t) nfssvc_encode_readlinkres, 627 + .pc_encode = nfssvc_encode_readlinkres, 628 628 .pc_argsize = sizeof(struct nfsd_readlinkargs), 629 629 .pc_ressize = sizeof(struct nfsd_readlinkres), 630 630 .pc_cachetype = RC_NOCACHE, ··· 633 633 [NFSPROC_READ] = { 634 634 .pc_func = nfsd_proc_read, 635 635 .pc_decode = nfssvc_decode_readargs, 636 - .pc_encode = (kxdrproc_t) nfssvc_encode_readres, 636 + .pc_encode = nfssvc_encode_readres, 637 637 .pc_release = nfssvc_release_fhandle, 638 638 .pc_argsize = sizeof(struct nfsd_readargs), 639 639 .pc_ressize = sizeof(struct nfsd_readres), ··· 642 642 }, 643 643 [NFSPROC_WRITECACHE] = { 644 644 .pc_decode = nfssvc_decode_void, 645 - .pc_encode = (kxdrproc_t) nfssvc_encode_void, 645 + .pc_encode = nfssvc_encode_void, 646 646 .pc_argsize = sizeof(struct nfsd_void), 647 647 .pc_ressize = sizeof(struct nfsd_void), 648 648 .pc_cachetype = RC_NOCACHE, ··· 651 651 [NFSPROC_WRITE] = { 652 652 .pc_func = nfsd_proc_write, 653 653 .pc_decode = nfssvc_decode_writeargs, 654 - .pc_encode = (kxdrproc_t) nfssvc_encode_attrstat, 654 + .pc_encode = nfssvc_encode_attrstat, 655 655 .pc_release = nfssvc_release_fhandle, 656 656 .pc_argsize = sizeof(struct nfsd_writeargs), 657 657 .pc_ressize = sizeof(struct nfsd_attrstat), ··· 661 661 [NFSPROC_CREATE] = { 662 662 .pc_func = nfsd_proc_create, 663 663 .pc_decode = nfssvc_decode_createargs, 664 - .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 664 + .pc_encode = nfssvc_encode_diropres, 665 665 .pc_release = nfssvc_release_fhandle, 666 666 .pc_argsize = sizeof(struct nfsd_createargs), 667 667 .pc_ressize = sizeof(struct nfsd_diropres), ··· 671 671 [NFSPROC_REMOVE] = { 672 672 .pc_func = nfsd_proc_remove, 673 673 .pc_decode = nfssvc_decode_diropargs, 674 - .pc_encode = (kxdrproc_t) nfssvc_encode_void, 674 + .pc_encode = nfssvc_encode_void, 675 675 .pc_argsize = sizeof(struct nfsd_diropargs), 676 676 .pc_ressize = sizeof(struct nfsd_void), 677 677 .pc_cachetype = RC_REPLSTAT, ··· 680 680 [NFSPROC_RENAME] = { 681 681 .pc_func = nfsd_proc_rename, 682 682 .pc_decode = nfssvc_decode_renameargs, 683 - .pc_encode = (kxdrproc_t) nfssvc_encode_void, 683 + .pc_encode = nfssvc_encode_void, 684 684 .pc_argsize = sizeof(struct nfsd_renameargs), 685 685 .pc_ressize = sizeof(struct nfsd_void), 686 686 .pc_cachetype = RC_REPLSTAT, ··· 689 689 [NFSPROC_LINK] = { 690 690 .pc_func = nfsd_proc_link, 691 691 .pc_decode = nfssvc_decode_linkargs, 692 - .pc_encode = (kxdrproc_t) nfssvc_encode_void, 692 + .pc_encode = nfssvc_encode_void, 693 693 .pc_argsize = sizeof(struct nfsd_linkargs), 694 694 .pc_ressize = sizeof(struct nfsd_void), 695 695 .pc_cachetype = RC_REPLSTAT, ··· 698 698 [NFSPROC_SYMLINK] = { 699 699 .pc_func = nfsd_proc_symlink, 700 700 .pc_decode = nfssvc_decode_symlinkargs, 701 - .pc_encode = (kxdrproc_t) nfssvc_encode_void, 701 + .pc_encode = nfssvc_encode_void, 702 702 .pc_argsize = sizeof(struct nfsd_symlinkargs), 703 703 .pc_ressize = sizeof(struct nfsd_void), 704 704 .pc_cachetype = RC_REPLSTAT, ··· 707 707 [NFSPROC_MKDIR] = { 708 708 .pc_func = nfsd_proc_mkdir, 709 709 .pc_decode = nfssvc_decode_createargs, 710 - .pc_encode = (kxdrproc_t) nfssvc_encode_diropres, 710 + .pc_encode = nfssvc_encode_diropres, 711 711 .pc_release = nfssvc_release_fhandle, 712 712 .pc_argsize = sizeof(struct nfsd_createargs), 713 713 .pc_ressize = sizeof(struct nfsd_diropres), ··· 717 717 [NFSPROC_RMDIR] = { 718 718 .pc_func = nfsd_proc_rmdir, 719 719 .pc_decode = nfssvc_decode_diropargs, 720 - .pc_encode = (kxdrproc_t) nfssvc_encode_void, 720 + .pc_encode = nfssvc_encode_void, 721 721 .pc_argsize = sizeof(struct nfsd_diropargs), 722 722 .pc_ressize = sizeof(struct nfsd_void), 723 723 .pc_cachetype = RC_REPLSTAT, ··· 726 726 [NFSPROC_READDIR] = { 727 727 .pc_func = nfsd_proc_readdir, 728 728 .pc_decode = nfssvc_decode_readdirargs, 729 - .pc_encode = (kxdrproc_t) nfssvc_encode_readdirres, 729 + .pc_encode = nfssvc_encode_readdirres, 730 730 .pc_argsize = sizeof(struct nfsd_readdirargs), 731 731 .pc_ressize = sizeof(struct nfsd_readdirres), 732 732 .pc_cachetype = RC_NOCACHE, ··· 734 734 [NFSPROC_STATFS] = { 735 735 .pc_func = nfsd_proc_statfs, 736 736 .pc_decode = nfssvc_decode_fhandle, 737 - .pc_encode = (kxdrproc_t) nfssvc_encode_statfsres, 737 + .pc_encode = nfssvc_encode_statfsres, 738 738 .pc_argsize = sizeof(struct nfsd_fhandle), 739 739 .pc_ressize = sizeof(struct nfsd_statfsres), 740 740 .pc_cachetype = RC_NOCACHE,
+1 -4
fs/nfsd/nfssvc.c
··· 782 782 nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp) 783 783 { 784 784 struct svc_procedure *proc; 785 - kxdrproc_t xdr; 786 785 __be32 nfserr; 787 786 __be32 *nfserrp; 788 787 ··· 840 841 * For NFSv2, additional info is never returned in case of an error. 841 842 */ 842 843 if (!(nfserr && rqstp->rq_vers == 2)) { 843 - xdr = proc->pc_encode; 844 - if (xdr && !xdr(rqstp, nfserrp, 845 - rqstp->rq_resp)) { 844 + if (proc->pc_encode && !proc->pc_encode(rqstp, nfserrp)) { 846 845 /* Failed to encode result. Release cache entry */ 847 846 dprintk("nfsd: failed to encode result!\n"); 848 847 nfsd_cache_update(rqstp, RC_NOCACHE, NULL);
+18 -13
fs/nfsd/nfsxdr.c
··· 429 429 * XDR encode functions 430 430 */ 431 431 int 432 - nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) 432 + nfssvc_encode_void(struct svc_rqst *rqstp, __be32 *p) 433 433 { 434 434 return xdr_ressize_check(rqstp, p); 435 435 } 436 436 437 437 int 438 - nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p, 439 - struct nfsd_attrstat *resp) 438 + nfssvc_encode_attrstat(struct svc_rqst *rqstp, __be32 *p) 440 439 { 440 + struct nfsd_attrstat *resp = rqstp->rq_resp; 441 + 441 442 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); 442 443 return xdr_ressize_check(rqstp, p); 443 444 } 444 445 445 446 int 446 - nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p, 447 - struct nfsd_diropres *resp) 447 + nfssvc_encode_diropres(struct svc_rqst *rqstp, __be32 *p) 448 448 { 449 + struct nfsd_diropres *resp = rqstp->rq_resp; 450 + 449 451 p = encode_fh(p, &resp->fh); 450 452 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); 451 453 return xdr_ressize_check(rqstp, p); 452 454 } 453 455 454 456 int 455 - nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p, 456 - struct nfsd_readlinkres *resp) 457 + nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p) 457 458 { 459 + struct nfsd_readlinkres *resp = rqstp->rq_resp; 460 + 458 461 *p++ = htonl(resp->len); 459 462 xdr_ressize_check(rqstp, p); 460 463 rqstp->rq_res.page_len = resp->len; ··· 471 468 } 472 469 473 470 int 474 - nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p, 475 - struct nfsd_readres *resp) 471 + nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p) 476 472 { 473 + struct nfsd_readres *resp = rqstp->rq_resp; 474 + 477 475 p = encode_fattr(rqstp, p, &resp->fh, &resp->stat); 478 476 *p++ = htonl(resp->count); 479 477 xdr_ressize_check(rqstp, p); ··· 491 487 } 492 488 493 489 int 494 - nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p, 495 - struct nfsd_readdirres *resp) 490 + nfssvc_encode_readdirres(struct svc_rqst *rqstp, __be32 *p) 496 491 { 492 + struct nfsd_readdirres *resp = rqstp->rq_resp; 493 + 497 494 xdr_ressize_check(rqstp, p); 498 495 p = resp->buffer; 499 496 *p++ = 0; /* no more entries */ ··· 505 500 } 506 501 507 502 int 508 - nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p, 509 - struct nfsd_statfsres *resp) 503 + nfssvc_encode_statfsres(struct svc_rqst *rqstp, __be32 *p) 510 504 { 505 + struct nfsd_statfsres *resp = rqstp->rq_resp; 511 506 struct kstatfs *stat = &resp->stats; 512 507 513 508 *p++ = htonl(NFSSVC_MAXBLKSIZE_V2); /* max transfer size */
+7 -7
fs/nfsd/xdr.h
··· 143 143 int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *); 144 144 int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *); 145 145 int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *); 146 - int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *); 147 - int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *); 148 - int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *); 149 - int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *); 150 - int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *); 151 - int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *); 152 - int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *); 146 + int nfssvc_encode_void(struct svc_rqst *, __be32 *); 147 + int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *); 148 + int nfssvc_encode_diropres(struct svc_rqst *, __be32 *); 149 + int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *); 150 + int nfssvc_encode_readres(struct svc_rqst *, __be32 *); 151 + int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *); 152 + int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *); 153 153 154 154 int nfssvc_encode_entry(void *, const char *name, 155 155 int namlen, loff_t offset, u64 ino, unsigned int);
+16 -29
fs/nfsd/xdr3.h
··· 285 285 int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *); 286 286 int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *); 287 287 int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *); 288 - int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 289 - int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *, 290 - struct nfsd3_attrstat *); 291 - int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *, 292 - struct nfsd3_attrstat *); 293 - int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *, 294 - struct nfsd3_diropres *); 295 - int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *, 296 - struct nfsd3_accessres *); 297 - int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *, 298 - struct nfsd3_readlinkres *); 299 - int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *); 300 - int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *); 301 - int nfs3svc_encode_createres(struct svc_rqst *, __be32 *, 302 - struct nfsd3_diropres *); 303 - int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *, 304 - struct nfsd3_renameres *); 305 - int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *, 306 - struct nfsd3_linkres *); 307 - int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *, 308 - struct nfsd3_readdirres *); 309 - int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *, 310 - struct nfsd3_fsstatres *); 311 - int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *, 312 - struct nfsd3_fsinfores *); 313 - int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *, 314 - struct nfsd3_pathconfres *); 315 - int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *, 316 - struct nfsd3_commitres *); 288 + int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *); 289 + int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *); 290 + int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *); 291 + int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *); 292 + int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *); 293 + int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *); 294 + int nfs3svc_encode_readres(struct svc_rqst *, __be32 *); 295 + int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *); 296 + int nfs3svc_encode_createres(struct svc_rqst *, __be32 *); 297 + int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *); 298 + int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *); 299 + int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *); 300 + int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *); 301 + int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *); 302 + int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *); 303 + int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *); 317 304 318 305 void nfs3svc_release_fhandle(struct svc_rqst *); 319 306 void nfs3svc_release_fhandle2(struct svc_rqst *);
+2 -3
fs/nfsd/xdr4.h
··· 682 682 683 683 684 684 bool nfsd4_mach_creds_match(struct nfs4_client *cl, struct svc_rqst *rqstp); 685 - int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 685 + int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *); 686 686 int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *); 687 - int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *, 688 - struct nfsd4_compoundres *); 687 + int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *); 689 688 __be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32); 690 689 void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); 691 690 void nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op);
+4 -4
include/linux/lockd/xdr.h
··· 96 96 #define NLMSVC_XDRSIZE sizeof(struct nlm_args) 97 97 98 98 int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *); 99 - int nlmsvc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *); 99 + int nlmsvc_encode_testres(struct svc_rqst *, __be32 *); 100 100 int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *); 101 101 int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *); 102 102 int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *); 103 - int nlmsvc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *); 103 + int nlmsvc_encode_res(struct svc_rqst *, __be32 *); 104 104 int nlmsvc_decode_res(struct svc_rqst *, __be32 *); 105 - int nlmsvc_encode_void(struct svc_rqst *, __be32 *, void *); 105 + int nlmsvc_encode_void(struct svc_rqst *, __be32 *); 106 106 int nlmsvc_decode_void(struct svc_rqst *, __be32 *); 107 107 int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *); 108 - int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *); 108 + int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *); 109 109 int nlmsvc_decode_notify(struct svc_rqst *, __be32 *); 110 110 int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *); 111 111 /*
+4 -4
include/linux/lockd/xdr4.h
··· 24 24 25 25 26 26 int nlm4svc_decode_testargs(struct svc_rqst *, __be32 *); 27 - int nlm4svc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *); 27 + int nlm4svc_encode_testres(struct svc_rqst *, __be32 *); 28 28 int nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *); 29 29 int nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *); 30 30 int nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *); 31 - int nlm4svc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *); 31 + int nlm4svc_encode_res(struct svc_rqst *, __be32 *); 32 32 int nlm4svc_decode_res(struct svc_rqst *, __be32 *); 33 - int nlm4svc_encode_void(struct svc_rqst *, __be32 *, void *); 33 + int nlm4svc_encode_void(struct svc_rqst *, __be32 *); 34 34 int nlm4svc_decode_void(struct svc_rqst *, __be32 *); 35 35 int nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *); 36 - int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *); 36 + int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *); 37 37 int nlm4svc_decode_notify(struct svc_rqst *, __be32 *); 38 38 int nlm4svc_decode_reboot(struct svc_rqst *, __be32 *); 39 39 /*
+2 -1
include/linux/sunrpc/svc.h
··· 423 423 __be32 (*pc_func)(struct svc_rqst *); 424 424 /* XDR decode args: */ 425 425 int (*pc_decode)(struct svc_rqst *, __be32 *data); 426 - kxdrproc_t pc_encode; /* XDR encode result */ 426 + /* XDR encode result: */ 427 + int (*pc_encode)(struct svc_rqst *, __be32 *data); 427 428 /* XDR free result: */ 428 429 void (*pc_release)(struct svc_rqst *); 429 430 unsigned int pc_argsize; /* argument struct size */
+2 -4
net/sunrpc/svc.c
··· 1154 1154 struct svc_version *versp = NULL; /* compiler food */ 1155 1155 struct svc_procedure *procp = NULL; 1156 1156 struct svc_serv *serv = rqstp->rq_server; 1157 - kxdrproc_t xdr; 1158 1157 __be32 *statp; 1159 1158 u32 prog, vers, proc; 1160 1159 __be32 auth_stat, rpc_stat; ··· 1297 1298 procp->pc_release(rqstp); 1298 1299 goto err_bad_auth; 1299 1300 } 1300 - if (*statp == rpc_success && 1301 - (xdr = procp->pc_encode) && 1302 - !xdr(rqstp, resv->iov_base+resv->iov_len, rqstp->rq_resp)) { 1301 + if (*statp == rpc_success && procp->pc_encode && 1302 + !procp->pc_encode(rqstp, resv->iov_base + resv->iov_len)) { 1303 1303 dprintk("svc: failed to encode reply\n"); 1304 1304 /* serv->sv_stats->rpcsystemerr++; */ 1305 1305 *statp = rpc_system_err;