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

nfsd4: properly type op_func callbacks

Pass union nfsd4_op_u to the op_func callbacks instead of using unsafe
function pointer casts.

It also adds two missing structures to struct nfsd4_op.u to facilitate
this.

Signed-off-by: Christoph Hellwig <hch@lst.de>

+209 -173
+126 -108
fs/nfsd/nfs4proc.c
··· 344 344 345 345 static __be32 346 346 nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 347 - struct nfsd4_open *open) 347 + union nfsd4_op_u *u) 348 348 { 349 + struct nfsd4_open *open = &u->open; 349 350 __be32 status; 350 351 struct svc_fh *resfh = NULL; 351 352 struct net *net = SVC_NET(rqstp); ··· 468 467 */ 469 468 static __be32 nfsd4_open_omfg(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_op *op) 470 469 { 471 - struct nfsd4_open *open = (struct nfsd4_open *)&op->u; 470 + struct nfsd4_open *open = &op->u.open; 472 471 473 472 if (!seqid_mutating_err(ntohl(op->status))) 474 473 return op->status; 475 474 if (nfsd4_has_session(cstate)) 476 475 return op->status; 477 476 open->op_xdr_error = op->status; 478 - return nfsd4_open(rqstp, cstate, open); 477 + return nfsd4_open(rqstp, cstate, &op->u); 479 478 } 480 479 481 480 /* ··· 483 482 */ 484 483 static __be32 485 484 nfsd4_getfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 486 - struct svc_fh **getfh) 485 + union nfsd4_op_u *u) 487 486 { 488 487 if (!cstate->current_fh.fh_dentry) 489 488 return nfserr_nofilehandle; 490 489 491 - *getfh = &cstate->current_fh; 490 + u->getfh = &cstate->current_fh; 492 491 return nfs_ok; 493 492 } 494 493 495 494 static __be32 496 495 nfsd4_putfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 497 - struct nfsd4_putfh *putfh) 496 + union nfsd4_op_u *u) 498 497 { 498 + struct nfsd4_putfh *putfh = &u->putfh; 499 + 499 500 fh_put(&cstate->current_fh); 500 501 cstate->current_fh.fh_handle.fh_size = putfh->pf_fhlen; 501 502 memcpy(&cstate->current_fh.fh_handle.fh_base, putfh->pf_fhval, ··· 507 504 508 505 static __be32 509 506 nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 510 - void *arg) 507 + union nfsd4_op_u *u) 511 508 { 512 509 __be32 status; 513 510 ··· 518 515 519 516 static __be32 520 517 nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 521 - void *arg) 518 + union nfsd4_op_u *u) 522 519 { 523 520 if (!cstate->save_fh.fh_dentry) 524 521 return nfserr_restorefh; ··· 533 530 534 531 static __be32 535 532 nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 536 - void *arg) 533 + union nfsd4_op_u *u) 537 534 { 538 535 if (!cstate->current_fh.fh_dentry) 539 536 return nfserr_nofilehandle; ··· 551 548 */ 552 549 static __be32 553 550 nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 554 - struct nfsd4_access *access) 551 + union nfsd4_op_u *u) 555 552 { 553 + struct nfsd4_access *access = &u->access; 554 + 556 555 if (access->ac_req_access & ~NFS3_ACCESS_FULL) 557 556 return nfserr_inval; 558 557 ··· 579 574 580 575 static __be32 581 576 nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 582 - struct nfsd4_commit *commit) 577 + union nfsd4_op_u *u) 583 578 { 579 + struct nfsd4_commit *commit = &u->commit; 580 + 584 581 gen_boot_verifier(&commit->co_verf, SVC_NET(rqstp)); 585 582 return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, 586 583 commit->co_count); ··· 590 583 591 584 static __be32 592 585 nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 593 - struct nfsd4_create *create) 586 + union nfsd4_op_u *u) 594 587 { 588 + struct nfsd4_create *create = &u->create; 595 589 struct svc_fh resfh; 596 590 __be32 status; 597 591 dev_t rdev; ··· 678 670 679 671 static __be32 680 672 nfsd4_getattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 681 - struct nfsd4_getattr *getattr) 673 + union nfsd4_op_u *u) 682 674 { 675 + struct nfsd4_getattr *getattr = &u->getattr; 683 676 __be32 status; 684 677 685 678 status = fh_verify(rqstp, &cstate->current_fh, 0, NFSD_MAY_NOP); ··· 700 691 701 692 static __be32 702 693 nfsd4_link(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 703 - struct nfsd4_link *link) 694 + union nfsd4_op_u *u) 704 695 { 696 + struct nfsd4_link *link = &u->link; 705 697 __be32 status = nfserr_nofilehandle; 706 698 707 699 if (!cstate->save_fh.fh_dentry) ··· 733 723 734 724 static __be32 735 725 nfsd4_lookupp(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 736 - void *arg) 726 + union nfsd4_op_u *u) 737 727 { 738 728 return nfsd4_do_lookupp(rqstp, &cstate->current_fh); 739 729 } 740 730 741 731 static __be32 742 732 nfsd4_lookup(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 743 - struct nfsd4_lookup *lookup) 733 + union nfsd4_op_u *u) 744 734 { 745 735 return nfsd_lookup(rqstp, &cstate->current_fh, 746 - lookup->lo_name, lookup->lo_len, 736 + u->lookup.lo_name, u->lookup.lo_len, 747 737 &cstate->current_fh); 748 738 } 749 739 750 740 static __be32 751 741 nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 752 - struct nfsd4_read *read) 742 + union nfsd4_op_u *u) 753 743 { 744 + struct nfsd4_read *read = &u->read; 754 745 __be32 status; 755 746 756 747 read->rd_filp = NULL; ··· 786 775 787 776 static __be32 788 777 nfsd4_readdir(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 789 - struct nfsd4_readdir *readdir) 778 + union nfsd4_op_u *u) 790 779 { 780 + struct nfsd4_readdir *readdir = &u->readdir; 791 781 u64 cookie = readdir->rd_cookie; 792 782 static const nfs4_verifier zeroverf; 793 783 ··· 812 800 813 801 static __be32 814 802 nfsd4_readlink(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 815 - struct nfsd4_readlink *readlink) 803 + union nfsd4_op_u *u) 816 804 { 817 - readlink->rl_rqstp = rqstp; 818 - readlink->rl_fhp = &cstate->current_fh; 805 + u->readlink.rl_rqstp = rqstp; 806 + u->readlink.rl_fhp = &cstate->current_fh; 819 807 return nfs_ok; 820 808 } 821 809 822 810 static __be32 823 811 nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 824 - struct nfsd4_remove *remove) 812 + union nfsd4_op_u *u) 825 813 { 814 + struct nfsd4_remove *remove = &u->remove; 826 815 __be32 status; 827 816 828 817 if (opens_in_grace(SVC_NET(rqstp))) ··· 839 826 840 827 static __be32 841 828 nfsd4_rename(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 842 - struct nfsd4_rename *rename) 829 + union nfsd4_op_u *u) 843 830 { 831 + struct nfsd4_rename *rename = &u->rename; 844 832 __be32 status = nfserr_nofilehandle; 845 833 846 834 if (!cstate->save_fh.fh_dentry) ··· 861 847 862 848 static __be32 863 849 nfsd4_secinfo(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 864 - struct nfsd4_secinfo *secinfo) 850 + union nfsd4_op_u *u) 865 851 { 852 + struct nfsd4_secinfo *secinfo = &u->secinfo; 866 853 struct svc_export *exp; 867 854 struct dentry *dentry; 868 855 __be32 err; ··· 891 876 892 877 static __be32 893 878 nfsd4_secinfo_no_name(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 894 - struct nfsd4_secinfo_no_name *sin) 879 + union nfsd4_op_u *u) 895 880 { 896 881 __be32 err; 897 882 898 - switch (sin->sin_style) { 883 + switch (u->secinfo_no_name.sin_style) { 899 884 case NFS4_SECINFO_STYLE4_CURRENT_FH: 900 885 break; 901 886 case NFS4_SECINFO_STYLE4_PARENT: ··· 907 892 return nfserr_inval; 908 893 } 909 894 910 - sin->sin_exp = exp_get(cstate->current_fh.fh_export); 895 + u->secinfo_no_name.sin_exp = exp_get(cstate->current_fh.fh_export); 911 896 fh_put(&cstate->current_fh); 912 897 return nfs_ok; 913 898 } 914 899 915 900 static __be32 916 901 nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 917 - struct nfsd4_setattr *setattr) 902 + union nfsd4_op_u *u) 918 903 { 904 + struct nfsd4_setattr *setattr = &u->setattr; 919 905 __be32 status = nfs_ok; 920 906 int err; 921 907 ··· 976 960 977 961 static __be32 978 962 nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 979 - struct nfsd4_write *write) 963 + union nfsd4_op_u *u) 980 964 { 965 + struct nfsd4_write *write = &u->write; 981 966 stateid_t *stateid = &write->wr_stateid; 982 967 struct file *filp = NULL; 983 968 __be32 status = nfs_ok; ··· 1051 1034 1052 1035 static __be32 1053 1036 nfsd4_clone(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1054 - struct nfsd4_clone *clone) 1037 + union nfsd4_op_u *u) 1055 1038 { 1039 + struct nfsd4_clone *clone = &u->clone; 1056 1040 struct file *src, *dst; 1057 1041 __be32 status; 1058 1042 ··· 1073 1055 1074 1056 static __be32 1075 1057 nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1076 - struct nfsd4_copy *copy) 1058 + union nfsd4_op_u *u) 1077 1059 { 1060 + struct nfsd4_copy *copy = &u->copy; 1078 1061 struct file *src, *dst; 1079 1062 __be32 status; 1080 1063 ssize_t bytes; ··· 1130 1111 1131 1112 static __be32 1132 1113 nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1133 - struct nfsd4_fallocate *fallocate) 1114 + union nfsd4_op_u *u) 1134 1115 { 1135 - return nfsd4_fallocate(rqstp, cstate, fallocate, 0); 1116 + return nfsd4_fallocate(rqstp, cstate, &u->allocate, 0); 1136 1117 } 1137 1118 1138 1119 static __be32 1139 1120 nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1140 - struct nfsd4_fallocate *fallocate) 1121 + union nfsd4_op_u *u) 1141 1122 { 1142 - return nfsd4_fallocate(rqstp, cstate, fallocate, 1123 + return nfsd4_fallocate(rqstp, cstate, &u->deallocate, 1143 1124 FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE); 1144 1125 } 1145 1126 1146 1127 static __be32 1147 1128 nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1148 - struct nfsd4_seek *seek) 1129 + union nfsd4_op_u *u) 1149 1130 { 1131 + struct nfsd4_seek *seek = &u->seek; 1150 1132 int whence; 1151 1133 __be32 status; 1152 1134 struct file *file; ··· 1252 1232 1253 1233 static __be32 1254 1234 nfsd4_nverify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1255 - struct nfsd4_verify *verify) 1235 + union nfsd4_op_u *u) 1256 1236 { 1257 1237 __be32 status; 1258 1238 1259 - status = _nfsd4_verify(rqstp, cstate, verify); 1239 + status = _nfsd4_verify(rqstp, cstate, &u->verify); 1260 1240 return status == nfserr_not_same ? nfs_ok : status; 1261 1241 } 1262 1242 1263 1243 static __be32 1264 1244 nfsd4_verify(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 1265 - struct nfsd4_verify *verify) 1245 + union nfsd4_op_u *u) 1266 1246 { 1267 1247 __be32 status; 1268 1248 1269 - status = _nfsd4_verify(rqstp, cstate, verify); 1249 + status = _nfsd4_verify(rqstp, cstate, &u->nverify); 1270 1250 return status == nfserr_same ? nfs_ok : status; 1271 1251 } 1272 1252 ··· 1291 1271 1292 1272 static __be32 1293 1273 nfsd4_getdeviceinfo(struct svc_rqst *rqstp, 1294 - struct nfsd4_compound_state *cstate, 1295 - struct nfsd4_getdeviceinfo *gdp) 1274 + struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) 1296 1275 { 1276 + struct nfsd4_getdeviceinfo *gdp = &u->getdeviceinfo; 1297 1277 const struct nfsd4_layout_ops *ops; 1298 1278 struct nfsd4_deviceid_map *map; 1299 1279 struct svc_export *exp; ··· 1337 1317 1338 1318 static __be32 1339 1319 nfsd4_layoutget(struct svc_rqst *rqstp, 1340 - struct nfsd4_compound_state *cstate, 1341 - struct nfsd4_layoutget *lgp) 1320 + struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) 1342 1321 { 1322 + struct nfsd4_layoutget *lgp = &u->layoutget; 1343 1323 struct svc_fh *current_fh = &cstate->current_fh; 1344 1324 const struct nfsd4_layout_ops *ops; 1345 1325 struct nfs4_layout_stateid *ls; ··· 1417 1397 1418 1398 static __be32 1419 1399 nfsd4_layoutcommit(struct svc_rqst *rqstp, 1420 - struct nfsd4_compound_state *cstate, 1421 - struct nfsd4_layoutcommit *lcp) 1400 + struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) 1422 1401 { 1402 + struct nfsd4_layoutcommit *lcp = &u->layoutcommit; 1423 1403 const struct nfsd4_layout_seg *seg = &lcp->lc_seg; 1424 1404 struct svc_fh *current_fh = &cstate->current_fh; 1425 1405 const struct nfsd4_layout_ops *ops; ··· 1481 1461 1482 1462 static __be32 1483 1463 nfsd4_layoutreturn(struct svc_rqst *rqstp, 1484 - struct nfsd4_compound_state *cstate, 1485 - struct nfsd4_layoutreturn *lrp) 1464 + struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) 1486 1465 { 1466 + struct nfsd4_layoutreturn *lrp = &u->layoutreturn; 1487 1467 struct svc_fh *current_fh = &cstate->current_fh; 1488 1468 __be32 nfserr; 1489 1469 ··· 1541 1521 nfsdstats.nfs4_opcount[opnum]++; 1542 1522 } 1543 1523 1544 - typedef __be32(*nfsd4op_func)(struct svc_rqst *, struct nfsd4_compound_state *, 1545 - void *); 1546 - 1547 1524 enum nfsd4_op_flags { 1548 1525 ALLOWED_WITHOUT_FH = 1 << 0, /* No current filehandle required */ 1549 1526 ALLOWED_ON_ABSENT_FS = 1 << 1, /* ops processed on absent fs */ ··· 1572 1555 }; 1573 1556 1574 1557 struct nfsd4_operation { 1575 - nfsd4op_func op_func; 1558 + __be32 (*op_func)(struct svc_rqst *, struct nfsd4_compound_state *, 1559 + union nfsd4_op_u *); 1576 1560 u32 op_flags; 1577 1561 char *op_name; 1578 1562 /* Try to get response size before operation */ ··· 2111 2093 2112 2094 static struct nfsd4_operation nfsd4_ops[] = { 2113 2095 [OP_ACCESS] = { 2114 - .op_func = (nfsd4op_func)nfsd4_access, 2096 + .op_func = nfsd4_access, 2115 2097 .op_name = "OP_ACCESS", 2116 2098 .op_rsize_bop = nfsd4_access_rsize, 2117 2099 }, 2118 2100 [OP_CLOSE] = { 2119 - .op_func = (nfsd4op_func)nfsd4_close, 2101 + .op_func = nfsd4_close, 2120 2102 .op_flags = OP_MODIFIES_SOMETHING, 2121 2103 .op_name = "OP_CLOSE", 2122 2104 .op_rsize_bop = nfsd4_status_stateid_rsize, ··· 2124 2106 .op_set_currentstateid = nfsd4_set_closestateid, 2125 2107 }, 2126 2108 [OP_COMMIT] = { 2127 - .op_func = (nfsd4op_func)nfsd4_commit, 2109 + .op_func = nfsd4_commit, 2128 2110 .op_flags = OP_MODIFIES_SOMETHING, 2129 2111 .op_name = "OP_COMMIT", 2130 2112 .op_rsize_bop = nfsd4_commit_rsize, 2131 2113 }, 2132 2114 [OP_CREATE] = { 2133 - .op_func = (nfsd4op_func)nfsd4_create, 2115 + .op_func = nfsd4_create, 2134 2116 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME | OP_CLEAR_STATEID, 2135 2117 .op_name = "OP_CREATE", 2136 2118 .op_rsize_bop = nfsd4_create_rsize, 2137 2119 }, 2138 2120 [OP_DELEGRETURN] = { 2139 - .op_func = (nfsd4op_func)nfsd4_delegreturn, 2121 + .op_func = nfsd4_delegreturn, 2140 2122 .op_flags = OP_MODIFIES_SOMETHING, 2141 2123 .op_name = "OP_DELEGRETURN", 2142 2124 .op_rsize_bop = nfsd4_only_status_rsize, 2143 2125 .op_get_currentstateid = nfsd4_get_delegreturnstateid, 2144 2126 }, 2145 2127 [OP_GETATTR] = { 2146 - .op_func = (nfsd4op_func)nfsd4_getattr, 2128 + .op_func = nfsd4_getattr, 2147 2129 .op_flags = ALLOWED_ON_ABSENT_FS, 2148 2130 .op_rsize_bop = nfsd4_getattr_rsize, 2149 2131 .op_name = "OP_GETATTR", 2150 2132 }, 2151 2133 [OP_GETFH] = { 2152 - .op_func = (nfsd4op_func)nfsd4_getfh, 2134 + .op_func = nfsd4_getfh, 2153 2135 .op_name = "OP_GETFH", 2154 2136 .op_rsize_bop = nfsd4_getfh_rsize, 2155 2137 }, 2156 2138 [OP_LINK] = { 2157 - .op_func = (nfsd4op_func)nfsd4_link, 2139 + .op_func = nfsd4_link, 2158 2140 .op_flags = ALLOWED_ON_ABSENT_FS | OP_MODIFIES_SOMETHING 2159 2141 | OP_CACHEME, 2160 2142 .op_name = "OP_LINK", 2161 2143 .op_rsize_bop = nfsd4_link_rsize, 2162 2144 }, 2163 2145 [OP_LOCK] = { 2164 - .op_func = (nfsd4op_func)nfsd4_lock, 2146 + .op_func = nfsd4_lock, 2165 2147 .op_flags = OP_MODIFIES_SOMETHING, 2166 2148 .op_name = "OP_LOCK", 2167 2149 .op_rsize_bop = nfsd4_lock_rsize, 2168 2150 .op_set_currentstateid = nfsd4_set_lockstateid, 2169 2151 }, 2170 2152 [OP_LOCKT] = { 2171 - .op_func = (nfsd4op_func)nfsd4_lockt, 2153 + .op_func = nfsd4_lockt, 2172 2154 .op_name = "OP_LOCKT", 2173 2155 .op_rsize_bop = nfsd4_lock_rsize, 2174 2156 }, 2175 2157 [OP_LOCKU] = { 2176 - .op_func = (nfsd4op_func)nfsd4_locku, 2158 + .op_func = nfsd4_locku, 2177 2159 .op_flags = OP_MODIFIES_SOMETHING, 2178 2160 .op_name = "OP_LOCKU", 2179 2161 .op_rsize_bop = nfsd4_status_stateid_rsize, 2180 2162 .op_get_currentstateid = nfsd4_get_lockustateid, 2181 2163 }, 2182 2164 [OP_LOOKUP] = { 2183 - .op_func = (nfsd4op_func)nfsd4_lookup, 2165 + .op_func = nfsd4_lookup, 2184 2166 .op_flags = OP_HANDLES_WRONGSEC | OP_CLEAR_STATEID, 2185 2167 .op_name = "OP_LOOKUP", 2186 2168 .op_rsize_bop = nfsd4_only_status_rsize, 2187 2169 }, 2188 2170 [OP_LOOKUPP] = { 2189 - .op_func = (nfsd4op_func)nfsd4_lookupp, 2171 + .op_func = nfsd4_lookupp, 2190 2172 .op_flags = OP_HANDLES_WRONGSEC | OP_CLEAR_STATEID, 2191 2173 .op_name = "OP_LOOKUPP", 2192 2174 .op_rsize_bop = nfsd4_only_status_rsize, 2193 2175 }, 2194 2176 [OP_NVERIFY] = { 2195 - .op_func = (nfsd4op_func)nfsd4_nverify, 2177 + .op_func = nfsd4_nverify, 2196 2178 .op_name = "OP_NVERIFY", 2197 2179 .op_rsize_bop = nfsd4_only_status_rsize, 2198 2180 }, 2199 2181 [OP_OPEN] = { 2200 - .op_func = (nfsd4op_func)nfsd4_open, 2182 + .op_func = nfsd4_open, 2201 2183 .op_flags = OP_HANDLES_WRONGSEC | OP_MODIFIES_SOMETHING, 2202 2184 .op_name = "OP_OPEN", 2203 2185 .op_rsize_bop = nfsd4_open_rsize, 2204 2186 .op_set_currentstateid = nfsd4_set_openstateid, 2205 2187 }, 2206 2188 [OP_OPEN_CONFIRM] = { 2207 - .op_func = (nfsd4op_func)nfsd4_open_confirm, 2189 + .op_func = nfsd4_open_confirm, 2208 2190 .op_flags = OP_MODIFIES_SOMETHING, 2209 2191 .op_name = "OP_OPEN_CONFIRM", 2210 2192 .op_rsize_bop = nfsd4_status_stateid_rsize, 2211 2193 }, 2212 2194 [OP_OPEN_DOWNGRADE] = { 2213 - .op_func = (nfsd4op_func)nfsd4_open_downgrade, 2195 + .op_func = nfsd4_open_downgrade, 2214 2196 .op_flags = OP_MODIFIES_SOMETHING, 2215 2197 .op_name = "OP_OPEN_DOWNGRADE", 2216 2198 .op_rsize_bop = nfsd4_status_stateid_rsize, ··· 2218 2200 .op_set_currentstateid = nfsd4_set_opendowngradestateid, 2219 2201 }, 2220 2202 [OP_PUTFH] = { 2221 - .op_func = (nfsd4op_func)nfsd4_putfh, 2203 + .op_func = nfsd4_putfh, 2222 2204 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2223 2205 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID, 2224 2206 .op_name = "OP_PUTFH", 2225 2207 .op_rsize_bop = nfsd4_only_status_rsize, 2226 2208 }, 2227 2209 [OP_PUTPUBFH] = { 2228 - .op_func = (nfsd4op_func)nfsd4_putrootfh, 2210 + .op_func = nfsd4_putrootfh, 2229 2211 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2230 2212 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID, 2231 2213 .op_name = "OP_PUTPUBFH", 2232 2214 .op_rsize_bop = nfsd4_only_status_rsize, 2233 2215 }, 2234 2216 [OP_PUTROOTFH] = { 2235 - .op_func = (nfsd4op_func)nfsd4_putrootfh, 2217 + .op_func = nfsd4_putrootfh, 2236 2218 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2237 2219 | OP_IS_PUTFH_LIKE | OP_CLEAR_STATEID, 2238 2220 .op_name = "OP_PUTROOTFH", 2239 2221 .op_rsize_bop = nfsd4_only_status_rsize, 2240 2222 }, 2241 2223 [OP_READ] = { 2242 - .op_func = (nfsd4op_func)nfsd4_read, 2224 + .op_func = nfsd4_read, 2243 2225 .op_name = "OP_READ", 2244 2226 .op_rsize_bop = nfsd4_read_rsize, 2245 2227 .op_get_currentstateid = nfsd4_get_readstateid, 2246 2228 }, 2247 2229 [OP_READDIR] = { 2248 - .op_func = (nfsd4op_func)nfsd4_readdir, 2230 + .op_func = nfsd4_readdir, 2249 2231 .op_name = "OP_READDIR", 2250 2232 .op_rsize_bop = nfsd4_readdir_rsize, 2251 2233 }, 2252 2234 [OP_READLINK] = { 2253 - .op_func = (nfsd4op_func)nfsd4_readlink, 2235 + .op_func = nfsd4_readlink, 2254 2236 .op_name = "OP_READLINK", 2255 2237 .op_rsize_bop = nfsd4_readlink_rsize, 2256 2238 }, 2257 2239 [OP_REMOVE] = { 2258 - .op_func = (nfsd4op_func)nfsd4_remove, 2240 + .op_func = nfsd4_remove, 2259 2241 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2260 2242 .op_name = "OP_REMOVE", 2261 2243 .op_rsize_bop = nfsd4_remove_rsize, 2262 2244 }, 2263 2245 [OP_RENAME] = { 2264 - .op_func = (nfsd4op_func)nfsd4_rename, 2246 + .op_func = nfsd4_rename, 2265 2247 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2266 2248 .op_name = "OP_RENAME", 2267 2249 .op_rsize_bop = nfsd4_rename_rsize, 2268 2250 }, 2269 2251 [OP_RENEW] = { 2270 - .op_func = (nfsd4op_func)nfsd4_renew, 2252 + .op_func = nfsd4_renew, 2271 2253 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2272 2254 | OP_MODIFIES_SOMETHING, 2273 2255 .op_name = "OP_RENEW", ··· 2275 2257 2276 2258 }, 2277 2259 [OP_RESTOREFH] = { 2278 - .op_func = (nfsd4op_func)nfsd4_restorefh, 2260 + .op_func = nfsd4_restorefh, 2279 2261 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2280 2262 | OP_IS_PUTFH_LIKE | OP_MODIFIES_SOMETHING, 2281 2263 .op_name = "OP_RESTOREFH", 2282 2264 .op_rsize_bop = nfsd4_only_status_rsize, 2283 2265 }, 2284 2266 [OP_SAVEFH] = { 2285 - .op_func = (nfsd4op_func)nfsd4_savefh, 2267 + .op_func = nfsd4_savefh, 2286 2268 .op_flags = OP_HANDLES_WRONGSEC | OP_MODIFIES_SOMETHING, 2287 2269 .op_name = "OP_SAVEFH", 2288 2270 .op_rsize_bop = nfsd4_only_status_rsize, 2289 2271 }, 2290 2272 [OP_SECINFO] = { 2291 - .op_func = (nfsd4op_func)nfsd4_secinfo, 2273 + .op_func = nfsd4_secinfo, 2292 2274 .op_flags = OP_HANDLES_WRONGSEC, 2293 2275 .op_name = "OP_SECINFO", 2294 2276 .op_rsize_bop = nfsd4_secinfo_rsize, 2295 2277 }, 2296 2278 [OP_SETATTR] = { 2297 - .op_func = (nfsd4op_func)nfsd4_setattr, 2279 + .op_func = nfsd4_setattr, 2298 2280 .op_name = "OP_SETATTR", 2299 2281 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2300 2282 .op_rsize_bop = nfsd4_setattr_rsize, 2301 2283 .op_get_currentstateid = nfsd4_get_setattrstateid, 2302 2284 }, 2303 2285 [OP_SETCLIENTID] = { 2304 - .op_func = (nfsd4op_func)nfsd4_setclientid, 2286 + .op_func = nfsd4_setclientid, 2305 2287 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2306 2288 | OP_MODIFIES_SOMETHING | OP_CACHEME, 2307 2289 .op_name = "OP_SETCLIENTID", 2308 2290 .op_rsize_bop = nfsd4_setclientid_rsize, 2309 2291 }, 2310 2292 [OP_SETCLIENTID_CONFIRM] = { 2311 - .op_func = (nfsd4op_func)nfsd4_setclientid_confirm, 2293 + .op_func = nfsd4_setclientid_confirm, 2312 2294 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2313 2295 | OP_MODIFIES_SOMETHING | OP_CACHEME, 2314 2296 .op_name = "OP_SETCLIENTID_CONFIRM", 2315 2297 .op_rsize_bop = nfsd4_only_status_rsize, 2316 2298 }, 2317 2299 [OP_VERIFY] = { 2318 - .op_func = (nfsd4op_func)nfsd4_verify, 2300 + .op_func = nfsd4_verify, 2319 2301 .op_name = "OP_VERIFY", 2320 2302 .op_rsize_bop = nfsd4_only_status_rsize, 2321 2303 }, 2322 2304 [OP_WRITE] = { 2323 - .op_func = (nfsd4op_func)nfsd4_write, 2305 + .op_func = nfsd4_write, 2324 2306 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2325 2307 .op_name = "OP_WRITE", 2326 2308 .op_rsize_bop = nfsd4_write_rsize, 2327 2309 .op_get_currentstateid = nfsd4_get_writestateid, 2328 2310 }, 2329 2311 [OP_RELEASE_LOCKOWNER] = { 2330 - .op_func = (nfsd4op_func)nfsd4_release_lockowner, 2312 + .op_func = nfsd4_release_lockowner, 2331 2313 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_ON_ABSENT_FS 2332 2314 | OP_MODIFIES_SOMETHING, 2333 2315 .op_name = "OP_RELEASE_LOCKOWNER", ··· 2336 2318 2337 2319 /* NFSv4.1 operations */ 2338 2320 [OP_EXCHANGE_ID] = { 2339 - .op_func = (nfsd4op_func)nfsd4_exchange_id, 2321 + .op_func = nfsd4_exchange_id, 2340 2322 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2341 2323 | OP_MODIFIES_SOMETHING, 2342 2324 .op_name = "OP_EXCHANGE_ID", 2343 2325 .op_rsize_bop = nfsd4_exchange_id_rsize, 2344 2326 }, 2345 2327 [OP_BACKCHANNEL_CTL] = { 2346 - .op_func = (nfsd4op_func)nfsd4_backchannel_ctl, 2328 + .op_func = nfsd4_backchannel_ctl, 2347 2329 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING, 2348 2330 .op_name = "OP_BACKCHANNEL_CTL", 2349 2331 .op_rsize_bop = nfsd4_only_status_rsize, 2350 2332 }, 2351 2333 [OP_BIND_CONN_TO_SESSION] = { 2352 - .op_func = (nfsd4op_func)nfsd4_bind_conn_to_session, 2334 + .op_func = nfsd4_bind_conn_to_session, 2353 2335 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2354 2336 | OP_MODIFIES_SOMETHING, 2355 2337 .op_name = "OP_BIND_CONN_TO_SESSION", 2356 2338 .op_rsize_bop = nfsd4_bind_conn_to_session_rsize, 2357 2339 }, 2358 2340 [OP_CREATE_SESSION] = { 2359 - .op_func = (nfsd4op_func)nfsd4_create_session, 2341 + .op_func = nfsd4_create_session, 2360 2342 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2361 2343 | OP_MODIFIES_SOMETHING, 2362 2344 .op_name = "OP_CREATE_SESSION", 2363 2345 .op_rsize_bop = nfsd4_create_session_rsize, 2364 2346 }, 2365 2347 [OP_DESTROY_SESSION] = { 2366 - .op_func = (nfsd4op_func)nfsd4_destroy_session, 2348 + .op_func = nfsd4_destroy_session, 2367 2349 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2368 2350 | OP_MODIFIES_SOMETHING, 2369 2351 .op_name = "OP_DESTROY_SESSION", 2370 2352 .op_rsize_bop = nfsd4_only_status_rsize, 2371 2353 }, 2372 2354 [OP_SEQUENCE] = { 2373 - .op_func = (nfsd4op_func)nfsd4_sequence, 2355 + .op_func = nfsd4_sequence, 2374 2356 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP, 2375 2357 .op_name = "OP_SEQUENCE", 2376 2358 .op_rsize_bop = nfsd4_sequence_rsize, 2377 2359 }, 2378 2360 [OP_DESTROY_CLIENTID] = { 2379 - .op_func = (nfsd4op_func)nfsd4_destroy_clientid, 2361 + .op_func = nfsd4_destroy_clientid, 2380 2362 .op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP 2381 2363 | OP_MODIFIES_SOMETHING, 2382 2364 .op_name = "OP_DESTROY_CLIENTID", 2383 2365 .op_rsize_bop = nfsd4_only_status_rsize, 2384 2366 }, 2385 2367 [OP_RECLAIM_COMPLETE] = { 2386 - .op_func = (nfsd4op_func)nfsd4_reclaim_complete, 2368 + .op_func = nfsd4_reclaim_complete, 2387 2369 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING, 2388 2370 .op_name = "OP_RECLAIM_COMPLETE", 2389 2371 .op_rsize_bop = nfsd4_only_status_rsize, 2390 2372 }, 2391 2373 [OP_SECINFO_NO_NAME] = { 2392 - .op_func = (nfsd4op_func)nfsd4_secinfo_no_name, 2374 + .op_func = nfsd4_secinfo_no_name, 2393 2375 .op_flags = OP_HANDLES_WRONGSEC, 2394 2376 .op_name = "OP_SECINFO_NO_NAME", 2395 2377 .op_rsize_bop = nfsd4_secinfo_rsize, 2396 2378 }, 2397 2379 [OP_TEST_STATEID] = { 2398 - .op_func = (nfsd4op_func)nfsd4_test_stateid, 2380 + .op_func = nfsd4_test_stateid, 2399 2381 .op_flags = ALLOWED_WITHOUT_FH, 2400 2382 .op_name = "OP_TEST_STATEID", 2401 2383 .op_rsize_bop = nfsd4_test_stateid_rsize, 2402 2384 }, 2403 2385 [OP_FREE_STATEID] = { 2404 - .op_func = (nfsd4op_func)nfsd4_free_stateid, 2386 + .op_func = nfsd4_free_stateid, 2405 2387 .op_flags = ALLOWED_WITHOUT_FH | OP_MODIFIES_SOMETHING, 2406 2388 .op_name = "OP_FREE_STATEID", 2407 2389 .op_get_currentstateid = nfsd4_get_freestateid, ··· 2409 2391 }, 2410 2392 #ifdef CONFIG_NFSD_PNFS 2411 2393 [OP_GETDEVICEINFO] = { 2412 - .op_func = (nfsd4op_func)nfsd4_getdeviceinfo, 2394 + .op_func = nfsd4_getdeviceinfo, 2413 2395 .op_flags = ALLOWED_WITHOUT_FH, 2414 2396 .op_name = "OP_GETDEVICEINFO", 2415 2397 .op_rsize_bop = nfsd4_getdeviceinfo_rsize, 2416 2398 }, 2417 2399 [OP_LAYOUTGET] = { 2418 - .op_func = (nfsd4op_func)nfsd4_layoutget, 2400 + .op_func = nfsd4_layoutget, 2419 2401 .op_flags = OP_MODIFIES_SOMETHING, 2420 2402 .op_name = "OP_LAYOUTGET", 2421 2403 .op_rsize_bop = nfsd4_layoutget_rsize, 2422 2404 }, 2423 2405 [OP_LAYOUTCOMMIT] = { 2424 - .op_func = (nfsd4op_func)nfsd4_layoutcommit, 2406 + .op_func = nfsd4_layoutcommit, 2425 2407 .op_flags = OP_MODIFIES_SOMETHING, 2426 2408 .op_name = "OP_LAYOUTCOMMIT", 2427 2409 .op_rsize_bop = nfsd4_layoutcommit_rsize, 2428 2410 }, 2429 2411 [OP_LAYOUTRETURN] = { 2430 - .op_func = (nfsd4op_func)nfsd4_layoutreturn, 2412 + .op_func = nfsd4_layoutreturn, 2431 2413 .op_flags = OP_MODIFIES_SOMETHING, 2432 2414 .op_name = "OP_LAYOUTRETURN", 2433 2415 .op_rsize_bop = nfsd4_layoutreturn_rsize, ··· 2436 2418 2437 2419 /* NFSv4.2 operations */ 2438 2420 [OP_ALLOCATE] = { 2439 - .op_func = (nfsd4op_func)nfsd4_allocate, 2421 + .op_func = nfsd4_allocate, 2440 2422 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2441 2423 .op_name = "OP_ALLOCATE", 2442 2424 .op_rsize_bop = nfsd4_only_status_rsize, 2443 2425 }, 2444 2426 [OP_DEALLOCATE] = { 2445 - .op_func = (nfsd4op_func)nfsd4_deallocate, 2427 + .op_func = nfsd4_deallocate, 2446 2428 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2447 2429 .op_name = "OP_DEALLOCATE", 2448 2430 .op_rsize_bop = nfsd4_only_status_rsize, 2449 2431 }, 2450 2432 [OP_CLONE] = { 2451 - .op_func = (nfsd4op_func)nfsd4_clone, 2433 + .op_func = nfsd4_clone, 2452 2434 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2453 2435 .op_name = "OP_CLONE", 2454 2436 .op_rsize_bop = nfsd4_only_status_rsize, 2455 2437 }, 2456 2438 [OP_COPY] = { 2457 - .op_func = (nfsd4op_func)nfsd4_copy, 2439 + .op_func = nfsd4_copy, 2458 2440 .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, 2459 2441 .op_name = "OP_COPY", 2460 2442 .op_rsize_bop = nfsd4_copy_rsize, 2461 2443 }, 2462 2444 [OP_SEEK] = { 2463 - .op_func = (nfsd4op_func)nfsd4_seek, 2445 + .op_func = nfsd4_seek, 2464 2446 .op_name = "OP_SEEK", 2465 2447 .op_rsize_bop = nfsd4_seek_rsize, 2466 2448 },
+52 -30
fs/nfsd/nfs4state.c
··· 2402 2402 } 2403 2403 2404 2404 __be32 2405 - nfsd4_exchange_id(struct svc_rqst *rqstp, 2406 - struct nfsd4_compound_state *cstate, 2407 - struct nfsd4_exchange_id *exid) 2405 + nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 2406 + union nfsd4_op_u *u) 2408 2407 { 2408 + struct nfsd4_exchange_id *exid = &u->exchange_id; 2409 2409 struct nfs4_client *conf, *new; 2410 2410 struct nfs4_client *unconf = NULL; 2411 2411 __be32 status; ··· 2698 2698 2699 2699 __be32 2700 2700 nfsd4_create_session(struct svc_rqst *rqstp, 2701 - struct nfsd4_compound_state *cstate, 2702 - struct nfsd4_create_session *cr_ses) 2701 + struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) 2703 2702 { 2703 + struct nfsd4_create_session *cr_ses = &u->create_session; 2704 2704 struct sockaddr *sa = svc_addr(rqstp); 2705 2705 struct nfs4_client *conf, *unconf; 2706 2706 struct nfs4_client *old = NULL; ··· 2824 2824 return nfserr_inval; 2825 2825 } 2826 2826 2827 - __be32 nfsd4_backchannel_ctl(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_backchannel_ctl *bc) 2827 + __be32 nfsd4_backchannel_ctl(struct svc_rqst *rqstp, 2828 + struct nfsd4_compound_state *cstate, 2829 + union nfsd4_op_u *u) 2828 2830 { 2831 + struct nfsd4_backchannel_ctl *bc = &u->backchannel_ctl; 2829 2832 struct nfsd4_session *session = cstate->session; 2830 2833 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); 2831 2834 __be32 status; ··· 2848 2845 2849 2846 __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp, 2850 2847 struct nfsd4_compound_state *cstate, 2851 - struct nfsd4_bind_conn_to_session *bcts) 2848 + union nfsd4_op_u *u) 2852 2849 { 2850 + struct nfsd4_bind_conn_to_session *bcts = &u->bind_conn_to_session; 2853 2851 __be32 status; 2854 2852 struct nfsd4_conn *conn; 2855 2853 struct nfsd4_session *session; ··· 2890 2886 } 2891 2887 2892 2888 __be32 2893 - nfsd4_destroy_session(struct svc_rqst *r, 2894 - struct nfsd4_compound_state *cstate, 2895 - struct nfsd4_destroy_session *sessionid) 2889 + nfsd4_destroy_session(struct svc_rqst *r, struct nfsd4_compound_state *cstate, 2890 + union nfsd4_op_u *u) 2896 2891 { 2892 + struct nfsd4_destroy_session *sessionid = &u->destroy_session; 2897 2893 struct nfsd4_session *ses; 2898 2894 __be32 status; 2899 2895 int ref_held_by_me = 0; ··· 2987 2983 } 2988 2984 2989 2985 __be32 2990 - nfsd4_sequence(struct svc_rqst *rqstp, 2991 - struct nfsd4_compound_state *cstate, 2992 - struct nfsd4_sequence *seq) 2986 + nfsd4_sequence(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 2987 + union nfsd4_op_u *u) 2993 2988 { 2989 + struct nfsd4_sequence *seq = &u->sequence; 2994 2990 struct nfsd4_compoundres *resp = rqstp->rq_resp; 2995 2991 struct xdr_stream *xdr = &resp->xdr; 2996 2992 struct nfsd4_session *session; ··· 3124 3120 } 3125 3121 3126 3122 __be32 3127 - nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc) 3123 + nfsd4_destroy_clientid(struct svc_rqst *rqstp, 3124 + struct nfsd4_compound_state *cstate, 3125 + union nfsd4_op_u *u) 3128 3126 { 3127 + struct nfsd4_destroy_clientid *dc = &u->destroy_clientid; 3129 3128 struct nfs4_client *conf, *unconf; 3130 3129 struct nfs4_client *clp = NULL; 3131 3130 __be32 status = 0; ··· 3168 3161 } 3169 3162 3170 3163 __be32 3171 - nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc) 3164 + nfsd4_reclaim_complete(struct svc_rqst *rqstp, 3165 + struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) 3172 3166 { 3167 + struct nfsd4_reclaim_complete *rc = &u->reclaim_complete; 3173 3168 __be32 status = 0; 3174 3169 3175 3170 if (rc->rca_one_fs) { ··· 3208 3199 3209 3200 __be32 3210 3201 nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 3211 - struct nfsd4_setclientid *setclid) 3202 + union nfsd4_op_u *u) 3212 3203 { 3204 + struct nfsd4_setclientid *setclid = &u->setclientid; 3213 3205 struct xdr_netobj clname = setclid->se_name; 3214 3206 nfs4_verifier clverifier = setclid->se_verf; 3215 3207 struct nfs4_client *conf, *new; ··· 3267 3257 3268 3258 __be32 3269 3259 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 3270 - struct nfsd4_compound_state *cstate, 3271 - struct nfsd4_setclientid_confirm *setclientid_confirm) 3260 + struct nfsd4_compound_state *cstate, 3261 + union nfsd4_op_u *u) 3272 3262 { 3263 + struct nfsd4_setclientid_confirm *setclientid_confirm = 3264 + &u->setclientid_confirm; 3273 3265 struct nfs4_client *conf, *unconf; 3274 3266 struct nfs4_client *old = NULL; 3275 3267 nfs4_verifier confirm = setclientid_confirm->sc_confirm; ··· 4518 4506 4519 4507 __be32 4520 4508 nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 4521 - clientid_t *clid) 4509 + union nfsd4_op_u *u) 4522 4510 { 4511 + clientid_t *clid = &u->renew; 4523 4512 struct nfs4_client *clp; 4524 4513 __be32 status; 4525 4514 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); ··· 5006 4993 */ 5007 4994 __be32 5008 4995 nfsd4_test_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5009 - struct nfsd4_test_stateid *test_stateid) 4996 + union nfsd4_op_u *u) 5010 4997 { 4998 + struct nfsd4_test_stateid *test_stateid = &u->test_stateid; 5011 4999 struct nfsd4_test_stateid_id *stateid; 5012 5000 struct nfs4_client *cl = cstate->session->se_client; 5013 5001 ··· 5047 5033 5048 5034 __be32 5049 5035 nfsd4_free_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5050 - struct nfsd4_free_stateid *free_stateid) 5036 + union nfsd4_op_u *u) 5051 5037 { 5038 + struct nfsd4_free_stateid *free_stateid = &u->free_stateid; 5052 5039 stateid_t *stateid = &free_stateid->fr_stateid; 5053 5040 struct nfs4_stid *s; 5054 5041 struct nfs4_delegation *dp; ··· 5177 5162 5178 5163 __be32 5179 5164 nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5180 - struct nfsd4_open_confirm *oc) 5165 + union nfsd4_op_u *u) 5181 5166 { 5167 + struct nfsd4_open_confirm *oc = &u->open_confirm; 5182 5168 __be32 status; 5183 5169 struct nfs4_openowner *oo; 5184 5170 struct nfs4_ol_stateid *stp; ··· 5246 5230 5247 5231 __be32 5248 5232 nfsd4_open_downgrade(struct svc_rqst *rqstp, 5249 - struct nfsd4_compound_state *cstate, 5250 - struct nfsd4_open_downgrade *od) 5233 + struct nfsd4_compound_state *cstate, union nfsd4_op_u *u) 5251 5234 { 5235 + struct nfsd4_open_downgrade *od = &u->open_downgrade; 5252 5236 __be32 status; 5253 5237 struct nfs4_ol_stateid *stp; 5254 5238 struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); ··· 5316 5300 */ 5317 5301 __be32 5318 5302 nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5319 - struct nfsd4_close *close) 5303 + union nfsd4_op_u *u) 5320 5304 { 5305 + struct nfsd4_close *close = &u->close; 5321 5306 __be32 status; 5322 5307 struct nfs4_ol_stateid *stp; 5323 5308 struct net *net = SVC_NET(rqstp); ··· 5347 5330 5348 5331 __be32 5349 5332 nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5350 - struct nfsd4_delegreturn *dr) 5333 + union nfsd4_op_u *u) 5351 5334 { 5335 + struct nfsd4_delegreturn *dr = &u->delegreturn; 5352 5336 struct nfs4_delegation *dp; 5353 5337 stateid_t *stateid = &dr->dr_stateid; 5354 5338 struct nfs4_stid *s; ··· 5724 5706 */ 5725 5707 __be32 5726 5708 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5727 - struct nfsd4_lock *lock) 5709 + union nfsd4_op_u *u) 5728 5710 { 5711 + struct nfsd4_lock *lock = &u->lock; 5729 5712 struct nfs4_openowner *open_sop = NULL; 5730 5713 struct nfs4_lockowner *lock_sop = NULL; 5731 5714 struct nfs4_ol_stateid *lock_stp = NULL; ··· 5958 5939 */ 5959 5940 __be32 5960 5941 nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 5961 - struct nfsd4_lockt *lockt) 5942 + union nfsd4_op_u *u) 5962 5943 { 5944 + struct nfsd4_lockt *lockt = &u->lockt; 5963 5945 struct file_lock *file_lock = NULL; 5964 5946 struct nfs4_lockowner *lo = NULL; 5965 5947 __be32 status; ··· 6032 6012 6033 6013 __be32 6034 6014 nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 6035 - struct nfsd4_locku *locku) 6015 + union nfsd4_op_u *u) 6036 6016 { 6017 + struct nfsd4_locku *locku = &u->locku; 6037 6018 struct nfs4_ol_stateid *stp; 6038 6019 struct file *filp = NULL; 6039 6020 struct file_lock *file_lock = NULL; ··· 6140 6119 __be32 6141 6120 nfsd4_release_lockowner(struct svc_rqst *rqstp, 6142 6121 struct nfsd4_compound_state *cstate, 6143 - struct nfsd4_release_lockowner *rlockowner) 6122 + union nfsd4_op_u *u) 6144 6123 { 6124 + struct nfsd4_release_lockowner *rlockowner = &u->release_lockowner; 6145 6125 clientid_t *clid = &rlockowner->rl_clientid; 6146 6126 struct nfs4_stateowner *sop; 6147 6127 struct nfs4_lockowner *lo = NULL;
+31 -35
fs/nfsd/xdr4.h
··· 577 577 struct nfsd4_bind_conn_to_session bind_conn_to_session; 578 578 struct nfsd4_create_session create_session; 579 579 struct nfsd4_destroy_session destroy_session; 580 + struct nfsd4_destroy_clientid destroy_clientid; 580 581 struct nfsd4_sequence sequence; 581 582 struct nfsd4_reclaim_complete reclaim_complete; 582 583 struct nfsd4_test_stateid test_stateid; ··· 586 585 struct nfsd4_layoutget layoutget; 587 586 struct nfsd4_layoutcommit layoutcommit; 588 587 struct nfsd4_layoutreturn layoutreturn; 588 + struct nfsd4_secinfo_no_name secinfo_no_name; 589 589 590 590 /* NFSv4.2 */ 591 591 struct nfsd4_fallocate allocate; ··· 695 693 struct dentry *dentry, 696 694 u32 *bmval, struct svc_rqst *, int ignore_crossmnt); 697 695 extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp, 698 - struct nfsd4_compound_state *, 699 - struct nfsd4_setclientid *setclid); 696 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 700 697 extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 701 - struct nfsd4_compound_state *, 702 - struct nfsd4_setclientid_confirm *setclientid_confirm); 698 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 703 699 extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp, 704 - struct nfsd4_compound_state *, struct nfsd4_exchange_id *); 705 - extern __be32 nfsd4_backchannel_ctl(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_backchannel_ctl *); 706 - extern __be32 nfsd4_bind_conn_to_session(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_bind_conn_to_session *); 700 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 701 + extern __be32 nfsd4_backchannel_ctl(struct svc_rqst *, 702 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 703 + extern __be32 nfsd4_bind_conn_to_session(struct svc_rqst *, 704 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 707 705 extern __be32 nfsd4_create_session(struct svc_rqst *, 708 - struct nfsd4_compound_state *, 709 - struct nfsd4_create_session *); 706 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 710 707 extern __be32 nfsd4_sequence(struct svc_rqst *, 711 - struct nfsd4_compound_state *, 712 - struct nfsd4_sequence *); 708 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 713 709 extern void nfsd4_sequence_done(struct nfsd4_compoundres *resp); 714 710 extern __be32 nfsd4_destroy_session(struct svc_rqst *, 715 - struct nfsd4_compound_state *, 716 - struct nfsd4_destroy_session *); 717 - extern __be32 nfsd4_destroy_clientid(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_destroy_clientid *); 718 - __be32 nfsd4_reclaim_complete(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_reclaim_complete *); 711 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 712 + extern __be32 nfsd4_destroy_clientid(struct svc_rqst *, struct nfsd4_compound_state *, 713 + union nfsd4_op_u *u); 714 + __be32 nfsd4_reclaim_complete(struct svc_rqst *, struct nfsd4_compound_state *, 715 + union nfsd4_op_u *u); 719 716 extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *, 720 717 struct nfsd4_open *open, struct nfsd_net *nn); 721 718 extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, ··· 723 722 extern void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate, 724 723 struct nfsd4_open *open); 725 724 extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, 726 - struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc); 727 - extern __be32 nfsd4_close(struct svc_rqst *rqstp, 728 - struct nfsd4_compound_state *, 729 - struct nfsd4_close *close); 725 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 726 + extern __be32 nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *, 727 + union nfsd4_op_u *u); 730 728 extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp, 731 - struct nfsd4_compound_state *, 732 - struct nfsd4_open_downgrade *od); 729 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 733 730 extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *, 734 - struct nfsd4_lock *lock); 735 - extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, 736 - struct nfsd4_compound_state *, 737 - struct nfsd4_lockt *lockt); 738 - extern __be32 nfsd4_locku(struct svc_rqst *rqstp, 739 - struct nfsd4_compound_state *, 740 - struct nfsd4_locku *locku); 731 + union nfsd4_op_u *u); 732 + extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *, 733 + union nfsd4_op_u *u); 734 + extern __be32 nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *, 735 + union nfsd4_op_u *u); 741 736 extern __be32 742 737 nfsd4_release_lockowner(struct svc_rqst *rqstp, 743 - struct nfsd4_compound_state *, 744 - struct nfsd4_release_lockowner *rlockowner); 738 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 745 739 extern void nfsd4_release_compoundargs(struct svc_rqst *rqstp); 746 740 extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, 747 - struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr); 748 - extern __be32 nfsd4_renew(struct svc_rqst *rqstp, 749 - struct nfsd4_compound_state *, clientid_t *clid); 741 + struct nfsd4_compound_state *, union nfsd4_op_u *u); 742 + extern __be32 nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *, 743 + union nfsd4_op_u *u); 750 744 extern __be32 nfsd4_test_stateid(struct svc_rqst *rqstp, 751 - struct nfsd4_compound_state *, struct nfsd4_test_stateid *test_stateid); 745 + struct nfsd4_compound_state *, union nfsd4_op_u *); 752 746 extern __be32 nfsd4_free_stateid(struct svc_rqst *rqstp, 753 - struct nfsd4_compound_state *, struct nfsd4_free_stateid *free_stateid); 747 + struct nfsd4_compound_state *, union nfsd4_op_u *); 754 748 extern void nfsd4_bump_seqid(struct nfsd4_compound_state *, __be32 nfserr); 755 749 756 750 #endif