diff options
author | Benny Halevy <bhalevy@panasas.com> | 2008-07-04 07:38:33 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-07-04 16:21:30 -0400 |
commit | 695e12f8d2917378d3b93059209e17415de96204 (patch) | |
tree | 12456e9a2ff2d1594e7d16083d5f74d0cf3546e5 /fs/nfsd | |
parent | e86322f611eef95aafaf726fd3965e5b211f1985 (diff) |
nfsd: tabulate nfs4 xdr encoding functions
In preparation for minorversion 1
All encoders now return an nfserr status (typically their
nfserr argument). Unsupported ops go through nfsd4_encode_operation
too, so use nfsd4_encode_noop to encode nothing for their reply body.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 205 |
1 files changed, 91 insertions, 114 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index a40bec53fa66..9b6a9bafc6b4 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1950,7 +1950,7 @@ fail: | |||
1950 | return -EINVAL; | 1950 | return -EINVAL; |
1951 | } | 1951 | } |
1952 | 1952 | ||
1953 | static void | 1953 | static __be32 |
1954 | nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_access *access) | 1954 | nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_access *access) |
1955 | { | 1955 | { |
1956 | ENCODE_HEAD; | 1956 | ENCODE_HEAD; |
@@ -1961,9 +1961,10 @@ nfsd4_encode_access(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_ | |||
1961 | WRITE32(access->ac_resp_access); | 1961 | WRITE32(access->ac_resp_access); |
1962 | ADJUST_ARGS(); | 1962 | ADJUST_ARGS(); |
1963 | } | 1963 | } |
1964 | return nfserr; | ||
1964 | } | 1965 | } |
1965 | 1966 | ||
1966 | static void | 1967 | static __be32 |
1967 | nfsd4_encode_close(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_close *close) | 1968 | nfsd4_encode_close(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_close *close) |
1968 | { | 1969 | { |
1969 | ENCODE_SEQID_OP_HEAD; | 1970 | ENCODE_SEQID_OP_HEAD; |
@@ -1975,10 +1976,11 @@ nfsd4_encode_close(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_c | |||
1975 | ADJUST_ARGS(); | 1976 | ADJUST_ARGS(); |
1976 | } | 1977 | } |
1977 | ENCODE_SEQID_OP_TAIL(close->cl_stateowner); | 1978 | ENCODE_SEQID_OP_TAIL(close->cl_stateowner); |
1979 | return nfserr; | ||
1978 | } | 1980 | } |
1979 | 1981 | ||
1980 | 1982 | ||
1981 | static void | 1983 | static __be32 |
1982 | nfsd4_encode_commit(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_commit *commit) | 1984 | nfsd4_encode_commit(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_commit *commit) |
1983 | { | 1985 | { |
1984 | ENCODE_HEAD; | 1986 | ENCODE_HEAD; |
@@ -1988,9 +1990,10 @@ nfsd4_encode_commit(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_ | |||
1988 | WRITEMEM(commit->co_verf.data, 8); | 1990 | WRITEMEM(commit->co_verf.data, 8); |
1989 | ADJUST_ARGS(); | 1991 | ADJUST_ARGS(); |
1990 | } | 1992 | } |
1993 | return nfserr; | ||
1991 | } | 1994 | } |
1992 | 1995 | ||
1993 | static void | 1996 | static __be32 |
1994 | nfsd4_encode_create(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_create *create) | 1997 | nfsd4_encode_create(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_create *create) |
1995 | { | 1998 | { |
1996 | ENCODE_HEAD; | 1999 | ENCODE_HEAD; |
@@ -2003,6 +2006,7 @@ nfsd4_encode_create(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_ | |||
2003 | WRITE32(create->cr_bmval[1]); | 2006 | WRITE32(create->cr_bmval[1]); |
2004 | ADJUST_ARGS(); | 2007 | ADJUST_ARGS(); |
2005 | } | 2008 | } |
2009 | return nfserr; | ||
2006 | } | 2010 | } |
2007 | 2011 | ||
2008 | static __be32 | 2012 | static __be32 |
@@ -2023,9 +2027,10 @@ nfsd4_encode_getattr(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4 | |||
2023 | return nfserr; | 2027 | return nfserr; |
2024 | } | 2028 | } |
2025 | 2029 | ||
2026 | static void | 2030 | static __be32 |
2027 | nfsd4_encode_getfh(struct nfsd4_compoundres *resp, __be32 nfserr, struct svc_fh *fhp) | 2031 | nfsd4_encode_getfh(struct nfsd4_compoundres *resp, __be32 nfserr, struct svc_fh **fhpp) |
2028 | { | 2032 | { |
2033 | struct svc_fh *fhp = *fhpp; | ||
2029 | unsigned int len; | 2034 | unsigned int len; |
2030 | ENCODE_HEAD; | 2035 | ENCODE_HEAD; |
2031 | 2036 | ||
@@ -2036,6 +2041,7 @@ nfsd4_encode_getfh(struct nfsd4_compoundres *resp, __be32 nfserr, struct svc_fh | |||
2036 | WRITEMEM(&fhp->fh_handle.fh_base, len); | 2041 | WRITEMEM(&fhp->fh_handle.fh_base, len); |
2037 | ADJUST_ARGS(); | 2042 | ADJUST_ARGS(); |
2038 | } | 2043 | } |
2044 | return nfserr; | ||
2039 | } | 2045 | } |
2040 | 2046 | ||
2041 | /* | 2047 | /* |
@@ -2063,7 +2069,7 @@ nfsd4_encode_lock_denied(struct nfsd4_compoundres *resp, struct nfsd4_lock_denie | |||
2063 | ADJUST_ARGS(); | 2069 | ADJUST_ARGS(); |
2064 | } | 2070 | } |
2065 | 2071 | ||
2066 | static void | 2072 | static __be32 |
2067 | nfsd4_encode_lock(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lock *lock) | 2073 | nfsd4_encode_lock(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lock *lock) |
2068 | { | 2074 | { |
2069 | ENCODE_SEQID_OP_HEAD; | 2075 | ENCODE_SEQID_OP_HEAD; |
@@ -2077,16 +2083,18 @@ nfsd4_encode_lock(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lo | |||
2077 | nfsd4_encode_lock_denied(resp, &lock->lk_denied); | 2083 | nfsd4_encode_lock_denied(resp, &lock->lk_denied); |
2078 | 2084 | ||
2079 | ENCODE_SEQID_OP_TAIL(lock->lk_replay_owner); | 2085 | ENCODE_SEQID_OP_TAIL(lock->lk_replay_owner); |
2086 | return nfserr; | ||
2080 | } | 2087 | } |
2081 | 2088 | ||
2082 | static void | 2089 | static __be32 |
2083 | nfsd4_encode_lockt(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lockt *lockt) | 2090 | nfsd4_encode_lockt(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_lockt *lockt) |
2084 | { | 2091 | { |
2085 | if (nfserr == nfserr_denied) | 2092 | if (nfserr == nfserr_denied) |
2086 | nfsd4_encode_lock_denied(resp, &lockt->lt_denied); | 2093 | nfsd4_encode_lock_denied(resp, &lockt->lt_denied); |
2094 | return nfserr; | ||
2087 | } | 2095 | } |
2088 | 2096 | ||
2089 | static void | 2097 | static __be32 |
2090 | nfsd4_encode_locku(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_locku *locku) | 2098 | nfsd4_encode_locku(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_locku *locku) |
2091 | { | 2099 | { |
2092 | ENCODE_SEQID_OP_HEAD; | 2100 | ENCODE_SEQID_OP_HEAD; |
@@ -2099,10 +2107,11 @@ nfsd4_encode_locku(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_l | |||
2099 | } | 2107 | } |
2100 | 2108 | ||
2101 | ENCODE_SEQID_OP_TAIL(locku->lu_stateowner); | 2109 | ENCODE_SEQID_OP_TAIL(locku->lu_stateowner); |
2110 | return nfserr; | ||
2102 | } | 2111 | } |
2103 | 2112 | ||
2104 | 2113 | ||
2105 | static void | 2114 | static __be32 |
2106 | nfsd4_encode_link(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_link *link) | 2115 | nfsd4_encode_link(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_link *link) |
2107 | { | 2116 | { |
2108 | ENCODE_HEAD; | 2117 | ENCODE_HEAD; |
@@ -2112,10 +2121,11 @@ nfsd4_encode_link(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_li | |||
2112 | WRITECINFO(link->li_cinfo); | 2121 | WRITECINFO(link->li_cinfo); |
2113 | ADJUST_ARGS(); | 2122 | ADJUST_ARGS(); |
2114 | } | 2123 | } |
2124 | return nfserr; | ||
2115 | } | 2125 | } |
2116 | 2126 | ||
2117 | 2127 | ||
2118 | static void | 2128 | static __be32 |
2119 | nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open *open) | 2129 | nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open *open) |
2120 | { | 2130 | { |
2121 | ENCODE_SEQID_OP_HEAD; | 2131 | ENCODE_SEQID_OP_HEAD; |
@@ -2178,9 +2188,10 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_op | |||
2178 | /* XXX save filehandle here */ | 2188 | /* XXX save filehandle here */ |
2179 | out: | 2189 | out: |
2180 | ENCODE_SEQID_OP_TAIL(open->op_stateowner); | 2190 | ENCODE_SEQID_OP_TAIL(open->op_stateowner); |
2191 | return nfserr; | ||
2181 | } | 2192 | } |
2182 | 2193 | ||
2183 | static void | 2194 | static __be32 |
2184 | nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open_confirm *oc) | 2195 | nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open_confirm *oc) |
2185 | { | 2196 | { |
2186 | ENCODE_SEQID_OP_HEAD; | 2197 | ENCODE_SEQID_OP_HEAD; |
@@ -2193,9 +2204,10 @@ nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, __be32 nfserr, struct | |||
2193 | } | 2204 | } |
2194 | 2205 | ||
2195 | ENCODE_SEQID_OP_TAIL(oc->oc_stateowner); | 2206 | ENCODE_SEQID_OP_TAIL(oc->oc_stateowner); |
2207 | return nfserr; | ||
2196 | } | 2208 | } |
2197 | 2209 | ||
2198 | static void | 2210 | static __be32 |
2199 | nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open_downgrade *od) | 2211 | nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_open_downgrade *od) |
2200 | { | 2212 | { |
2201 | ENCODE_SEQID_OP_HEAD; | 2213 | ENCODE_SEQID_OP_HEAD; |
@@ -2208,6 +2220,7 @@ nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, __be32 nfserr, struc | |||
2208 | } | 2220 | } |
2209 | 2221 | ||
2210 | ENCODE_SEQID_OP_TAIL(od->od_stateowner); | 2222 | ENCODE_SEQID_OP_TAIL(od->od_stateowner); |
2223 | return nfserr; | ||
2211 | } | 2224 | } |
2212 | 2225 | ||
2213 | static __be32 | 2226 | static __be32 |
@@ -2402,7 +2415,7 @@ err_no_verf: | |||
2402 | return nfserr; | 2415 | return nfserr; |
2403 | } | 2416 | } |
2404 | 2417 | ||
2405 | static void | 2418 | static __be32 |
2406 | nfsd4_encode_remove(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_remove *remove) | 2419 | nfsd4_encode_remove(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_remove *remove) |
2407 | { | 2420 | { |
2408 | ENCODE_HEAD; | 2421 | ENCODE_HEAD; |
@@ -2412,9 +2425,10 @@ nfsd4_encode_remove(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_ | |||
2412 | WRITECINFO(remove->rm_cinfo); | 2425 | WRITECINFO(remove->rm_cinfo); |
2413 | ADJUST_ARGS(); | 2426 | ADJUST_ARGS(); |
2414 | } | 2427 | } |
2428 | return nfserr; | ||
2415 | } | 2429 | } |
2416 | 2430 | ||
2417 | static void | 2431 | static __be32 |
2418 | nfsd4_encode_rename(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_rename *rename) | 2432 | nfsd4_encode_rename(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_rename *rename) |
2419 | { | 2433 | { |
2420 | ENCODE_HEAD; | 2434 | ENCODE_HEAD; |
@@ -2425,9 +2439,10 @@ nfsd4_encode_rename(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_ | |||
2425 | WRITECINFO(rename->rn_tinfo); | 2439 | WRITECINFO(rename->rn_tinfo); |
2426 | ADJUST_ARGS(); | 2440 | ADJUST_ARGS(); |
2427 | } | 2441 | } |
2442 | return nfserr; | ||
2428 | } | 2443 | } |
2429 | 2444 | ||
2430 | static void | 2445 | static __be32 |
2431 | nfsd4_encode_secinfo(struct nfsd4_compoundres *resp, __be32 nfserr, | 2446 | nfsd4_encode_secinfo(struct nfsd4_compoundres *resp, __be32 nfserr, |
2432 | struct nfsd4_secinfo *secinfo) | 2447 | struct nfsd4_secinfo *secinfo) |
2433 | { | 2448 | { |
@@ -2491,13 +2506,14 @@ nfsd4_encode_secinfo(struct nfsd4_compoundres *resp, __be32 nfserr, | |||
2491 | out: | 2506 | out: |
2492 | if (exp) | 2507 | if (exp) |
2493 | exp_put(exp); | 2508 | exp_put(exp); |
2509 | return nfserr; | ||
2494 | } | 2510 | } |
2495 | 2511 | ||
2496 | /* | 2512 | /* |
2497 | * The SETATTR encode routine is special -- it always encodes a bitmap, | 2513 | * The SETATTR encode routine is special -- it always encodes a bitmap, |
2498 | * regardless of the error status. | 2514 | * regardless of the error status. |
2499 | */ | 2515 | */ |
2500 | static void | 2516 | static __be32 |
2501 | nfsd4_encode_setattr(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_setattr *setattr) | 2517 | nfsd4_encode_setattr(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_setattr *setattr) |
2502 | { | 2518 | { |
2503 | ENCODE_HEAD; | 2519 | ENCODE_HEAD; |
@@ -2514,9 +2530,10 @@ nfsd4_encode_setattr(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4 | |||
2514 | WRITE32(setattr->sa_bmval[1]); | 2530 | WRITE32(setattr->sa_bmval[1]); |
2515 | } | 2531 | } |
2516 | ADJUST_ARGS(); | 2532 | ADJUST_ARGS(); |
2533 | return nfserr; | ||
2517 | } | 2534 | } |
2518 | 2535 | ||
2519 | static void | 2536 | static __be32 |
2520 | nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_setclientid *scd) | 2537 | nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_setclientid *scd) |
2521 | { | 2538 | { |
2522 | ENCODE_HEAD; | 2539 | ENCODE_HEAD; |
@@ -2533,9 +2550,10 @@ nfsd4_encode_setclientid(struct nfsd4_compoundres *resp, __be32 nfserr, struct n | |||
2533 | WRITE32(0); | 2550 | WRITE32(0); |
2534 | ADJUST_ARGS(); | 2551 | ADJUST_ARGS(); |
2535 | } | 2552 | } |
2553 | return nfserr; | ||
2536 | } | 2554 | } |
2537 | 2555 | ||
2538 | static void | 2556 | static __be32 |
2539 | nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_write *write) | 2557 | nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_write *write) |
2540 | { | 2558 | { |
2541 | ENCODE_HEAD; | 2559 | ENCODE_HEAD; |
@@ -2547,8 +2565,56 @@ nfsd4_encode_write(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_w | |||
2547 | WRITEMEM(write->wr_verifier.data, 8); | 2565 | WRITEMEM(write->wr_verifier.data, 8); |
2548 | ADJUST_ARGS(); | 2566 | ADJUST_ARGS(); |
2549 | } | 2567 | } |
2568 | return nfserr; | ||
2550 | } | 2569 | } |
2551 | 2570 | ||
2571 | static __be32 | ||
2572 | nfsd4_encode_noop(struct nfsd4_compoundres *resp, __be32 nfserr, void *p) | ||
2573 | { | ||
2574 | return nfserr; | ||
2575 | } | ||
2576 | |||
2577 | typedef __be32(* nfsd4_enc)(struct nfsd4_compoundres *, __be32, void *); | ||
2578 | |||
2579 | static nfsd4_enc nfsd4_enc_ops[] = { | ||
2580 | [OP_ACCESS] (nfsd4_enc)nfsd4_encode_access, | ||
2581 | [OP_CLOSE] (nfsd4_enc)nfsd4_encode_close, | ||
2582 | [OP_COMMIT] (nfsd4_enc)nfsd4_encode_commit, | ||
2583 | [OP_CREATE] (nfsd4_enc)nfsd4_encode_create, | ||
2584 | [OP_DELEGPURGE] (nfsd4_enc)nfsd4_encode_noop, | ||
2585 | [OP_DELEGRETURN] (nfsd4_enc)nfsd4_encode_noop, | ||
2586 | [OP_GETATTR] (nfsd4_enc)nfsd4_encode_getattr, | ||
2587 | [OP_GETFH] (nfsd4_enc)nfsd4_encode_getfh, | ||
2588 | [OP_LINK] (nfsd4_enc)nfsd4_encode_link, | ||
2589 | [OP_LOCK] (nfsd4_enc)nfsd4_encode_lock, | ||
2590 | [OP_LOCKT] (nfsd4_enc)nfsd4_encode_lockt, | ||
2591 | [OP_LOCKU] (nfsd4_enc)nfsd4_encode_locku, | ||
2592 | [OP_LOOKUP] (nfsd4_enc)nfsd4_encode_noop, | ||
2593 | [OP_LOOKUPP] (nfsd4_enc)nfsd4_encode_noop, | ||
2594 | [OP_NVERIFY] (nfsd4_enc)nfsd4_encode_noop, | ||
2595 | [OP_OPEN] (nfsd4_enc)nfsd4_encode_open, | ||
2596 | [OP_OPEN_CONFIRM] (nfsd4_enc)nfsd4_encode_open_confirm, | ||
2597 | [OP_OPEN_DOWNGRADE] (nfsd4_enc)nfsd4_encode_open_downgrade, | ||
2598 | [OP_PUTFH] (nfsd4_enc)nfsd4_encode_noop, | ||
2599 | [OP_PUTPUBFH] (nfsd4_enc)nfsd4_encode_noop, | ||
2600 | [OP_PUTROOTFH] (nfsd4_enc)nfsd4_encode_noop, | ||
2601 | [OP_READ] (nfsd4_enc)nfsd4_encode_read, | ||
2602 | [OP_READDIR] (nfsd4_enc)nfsd4_encode_readdir, | ||
2603 | [OP_READLINK] (nfsd4_enc)nfsd4_encode_readlink, | ||
2604 | [OP_REMOVE] (nfsd4_enc)nfsd4_encode_remove, | ||
2605 | [OP_RENAME] (nfsd4_enc)nfsd4_encode_rename, | ||
2606 | [OP_RENEW] (nfsd4_enc)nfsd4_encode_noop, | ||
2607 | [OP_RESTOREFH] (nfsd4_enc)nfsd4_encode_noop, | ||
2608 | [OP_SAVEFH] (nfsd4_enc)nfsd4_encode_noop, | ||
2609 | [OP_SECINFO] (nfsd4_enc)nfsd4_encode_secinfo, | ||
2610 | [OP_SETATTR] (nfsd4_enc)nfsd4_encode_setattr, | ||
2611 | [OP_SETCLIENTID] (nfsd4_enc)nfsd4_encode_setclientid, | ||
2612 | [OP_SETCLIENTID_CONFIRM](nfsd4_enc)nfsd4_encode_noop, | ||
2613 | [OP_VERIFY] (nfsd4_enc)nfsd4_encode_noop, | ||
2614 | [OP_WRITE] (nfsd4_enc)nfsd4_encode_write, | ||
2615 | [OP_RELEASE_LOCKOWNER] (nfsd4_enc)nfsd4_encode_noop, | ||
2616 | }; | ||
2617 | |||
2552 | void | 2618 | void |
2553 | nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op) | 2619 | nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op) |
2554 | { | 2620 | { |
@@ -2560,101 +2626,12 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op) | |||
2560 | statp = p++; /* to be backfilled at the end */ | 2626 | statp = p++; /* to be backfilled at the end */ |
2561 | ADJUST_ARGS(); | 2627 | ADJUST_ARGS(); |
2562 | 2628 | ||
2563 | switch (op->opnum) { | 2629 | if (op->opnum == OP_ILLEGAL) |
2564 | case OP_ACCESS: | 2630 | goto status; |
2565 | nfsd4_encode_access(resp, op->status, &op->u.access); | 2631 | BUG_ON(op->opnum < 0 || op->opnum >= ARRAY_SIZE(nfsd4_enc_ops) || |
2566 | break; | 2632 | !nfsd4_enc_ops[op->opnum]); |
2567 | case OP_CLOSE: | 2633 | op->status = nfsd4_enc_ops[op->opnum](resp, op->status, &op->u); |
2568 | nfsd4_encode_close(resp, op->status, &op->u.close); | 2634 | status: |
2569 | break; | ||
2570 | case OP_COMMIT: | ||
2571 | nfsd4_encode_commit(resp, op->status, &op->u.commit); | ||
2572 | break; | ||
2573 | case OP_CREATE: | ||
2574 | nfsd4_encode_create(resp, op->status, &op->u.create); | ||
2575 | break; | ||
2576 | case OP_DELEGRETURN: | ||
2577 | break; | ||
2578 | case OP_GETATTR: | ||
2579 | op->status = nfsd4_encode_getattr(resp, op->status, &op->u.getattr); | ||
2580 | break; | ||
2581 | case OP_GETFH: | ||
2582 | nfsd4_encode_getfh(resp, op->status, op->u.getfh); | ||
2583 | break; | ||
2584 | case OP_LINK: | ||
2585 | nfsd4_encode_link(resp, op->status, &op->u.link); | ||
2586 | break; | ||
2587 | case OP_LOCK: | ||
2588 | nfsd4_encode_lock(resp, op->status, &op->u.lock); | ||
2589 | break; | ||
2590 | case OP_LOCKT: | ||
2591 | nfsd4_encode_lockt(resp, op->status, &op->u.lockt); | ||
2592 | break; | ||
2593 | case OP_LOCKU: | ||
2594 | nfsd4_encode_locku(resp, op->status, &op->u.locku); | ||
2595 | break; | ||
2596 | case OP_LOOKUP: | ||
2597 | break; | ||
2598 | case OP_LOOKUPP: | ||
2599 | break; | ||
2600 | case OP_NVERIFY: | ||
2601 | break; | ||
2602 | case OP_OPEN: | ||
2603 | nfsd4_encode_open(resp, op->status, &op->u.open); | ||
2604 | break; | ||
2605 | case OP_OPEN_CONFIRM: | ||
2606 | nfsd4_encode_open_confirm(resp, op->status, &op->u.open_confirm); | ||
2607 | break; | ||
2608 | case OP_OPEN_DOWNGRADE: | ||
2609 | nfsd4_encode_open_downgrade(resp, op->status, &op->u.open_downgrade); | ||
2610 | break; | ||
2611 | case OP_PUTFH: | ||
2612 | break; | ||
2613 | case OP_PUTROOTFH: | ||
2614 | break; | ||
2615 | case OP_READ: | ||
2616 | op->status = nfsd4_encode_read(resp, op->status, &op->u.read); | ||
2617 | break; | ||
2618 | case OP_READDIR: | ||
2619 | op->status = nfsd4_encode_readdir(resp, op->status, &op->u.readdir); | ||
2620 | break; | ||
2621 | case OP_READLINK: | ||
2622 | op->status = nfsd4_encode_readlink(resp, op->status, &op->u.readlink); | ||
2623 | break; | ||
2624 | case OP_REMOVE: | ||
2625 | nfsd4_encode_remove(resp, op->status, &op->u.remove); | ||
2626 | break; | ||
2627 | case OP_RENAME: | ||
2628 | nfsd4_encode_rename(resp, op->status, &op->u.rename); | ||
2629 | break; | ||
2630 | case OP_RENEW: | ||
2631 | break; | ||
2632 | case OP_RESTOREFH: | ||
2633 | break; | ||
2634 | case OP_SAVEFH: | ||
2635 | break; | ||
2636 | case OP_SECINFO: | ||
2637 | nfsd4_encode_secinfo(resp, op->status, &op->u.secinfo); | ||
2638 | break; | ||
2639 | case OP_SETATTR: | ||
2640 | nfsd4_encode_setattr(resp, op->status, &op->u.setattr); | ||
2641 | break; | ||
2642 | case OP_SETCLIENTID: | ||
2643 | nfsd4_encode_setclientid(resp, op->status, &op->u.setclientid); | ||
2644 | break; | ||
2645 | case OP_SETCLIENTID_CONFIRM: | ||
2646 | break; | ||
2647 | case OP_VERIFY: | ||
2648 | break; | ||
2649 | case OP_WRITE: | ||
2650 | nfsd4_encode_write(resp, op->status, &op->u.write); | ||
2651 | break; | ||
2652 | case OP_RELEASE_LOCKOWNER: | ||
2653 | break; | ||
2654 | default: | ||
2655 | break; | ||
2656 | } | ||
2657 | |||
2658 | /* | 2635 | /* |
2659 | * Note: We write the status directly, instead of using WRITE32(), | 2636 | * Note: We write the status directly, instead of using WRITE32(), |
2660 | * since it is already in network byte order. | 2637 | * since it is already in network byte order. |