aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-12-14 09:59:29 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-12-16 12:37:25 -0500
commitbf2695516db982e90a22fc94f93491b481796bb1 (patch)
tree367bf134ef892bfc3fcd2c4fe676b14102d97467 /fs/nfs/nfs4xdr.c
parent9f06c719f474be7003763284a990bed6377bb0d4 (diff)
SUNRPC: New xdr_streams XDR decoder API
Now that all client-side XDR decoder routines use xdr_streams, there should be no need to support the legacy calling sequence [rpc_rqst *, __be32 *, RPC res *] anywhere. We can construct an xdr_stream in the generic RPC code, instead of in each decoder function. This is a refactoring change. It should not cause different behavior. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Tested-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c619
1 files changed, 303 insertions, 316 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 6ec38b3e4a3d..f3f99156bfcb 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -5013,26 +5013,26 @@ out_overflow:
5013/* 5013/*
5014 * Decode OPEN_DOWNGRADE response 5014 * Decode OPEN_DOWNGRADE response
5015 */ 5015 */
5016static int nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, __be32 *p, struct nfs_closeres *res) 5016static int nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp,
5017 struct xdr_stream *xdr,
5018 struct nfs_closeres *res)
5017{ 5019{
5018 struct xdr_stream xdr;
5019 struct compound_hdr hdr; 5020 struct compound_hdr hdr;
5020 int status; 5021 int status;
5021 5022
5022 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5023 status = decode_compound_hdr(xdr, &hdr);
5023 status = decode_compound_hdr(&xdr, &hdr);
5024 if (status) 5024 if (status)
5025 goto out; 5025 goto out;
5026 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5026 status = decode_sequence(xdr, &res->seq_res, rqstp);
5027 if (status) 5027 if (status)
5028 goto out; 5028 goto out;
5029 status = decode_putfh(&xdr); 5029 status = decode_putfh(xdr);
5030 if (status) 5030 if (status)
5031 goto out; 5031 goto out;
5032 status = decode_open_downgrade(&xdr, res); 5032 status = decode_open_downgrade(xdr, res);
5033 if (status != 0) 5033 if (status != 0)
5034 goto out; 5034 goto out;
5035 decode_getfattr(&xdr, res->fattr, res->server, 5035 decode_getfattr(xdr, res->fattr, res->server,
5036 !RPC_IS_ASYNC(rqstp->rq_task)); 5036 !RPC_IS_ASYNC(rqstp->rq_task));
5037out: 5037out:
5038 return status; 5038 return status;
@@ -5041,26 +5041,25 @@ out:
5041/* 5041/*
5042 * Decode ACCESS response 5042 * Decode ACCESS response
5043 */ 5043 */
5044static int nfs4_xdr_dec_access(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_accessres *res) 5044static int nfs4_xdr_dec_access(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5045 struct nfs4_accessres *res)
5045{ 5046{
5046 struct xdr_stream xdr;
5047 struct compound_hdr hdr; 5047 struct compound_hdr hdr;
5048 int status; 5048 int status;
5049 5049
5050 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5050 status = decode_compound_hdr(xdr, &hdr);
5051 status = decode_compound_hdr(&xdr, &hdr);
5052 if (status) 5051 if (status)
5053 goto out; 5052 goto out;
5054 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5053 status = decode_sequence(xdr, &res->seq_res, rqstp);
5055 if (status) 5054 if (status)
5056 goto out; 5055 goto out;
5057 status = decode_putfh(&xdr); 5056 status = decode_putfh(xdr);
5058 if (status != 0) 5057 if (status != 0)
5059 goto out; 5058 goto out;
5060 status = decode_access(&xdr, res); 5059 status = decode_access(xdr, res);
5061 if (status != 0) 5060 if (status != 0)
5062 goto out; 5061 goto out;
5063 decode_getfattr(&xdr, res->fattr, res->server, 5062 decode_getfattr(xdr, res->fattr, res->server,
5064 !RPC_IS_ASYNC(rqstp->rq_task)); 5063 !RPC_IS_ASYNC(rqstp->rq_task));
5065out: 5064out:
5066 return status; 5065 return status;
@@ -5069,26 +5068,28 @@ out:
5069/* 5068/*
5070 * Decode LOOKUP response 5069 * Decode LOOKUP response
5071 */ 5070 */
5072static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_lookup_res *res) 5071static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5072 struct nfs4_lookup_res *res)
5073{ 5073{
5074 struct xdr_stream xdr;
5075 struct compound_hdr hdr; 5074 struct compound_hdr hdr;
5076 int status; 5075 int status;
5077 5076
5078 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5077 status = decode_compound_hdr(xdr, &hdr);
5079 status = decode_compound_hdr(&xdr, &hdr);
5080 if (status) 5078 if (status)
5081 goto out; 5079 goto out;
5082 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5080 status = decode_sequence(xdr, &res->seq_res, rqstp);
5083 if (status) 5081 if (status)
5084 goto out; 5082 goto out;
5085 if ((status = decode_putfh(&xdr)) != 0) 5083 status = decode_putfh(xdr);
5084 if (status)
5086 goto out; 5085 goto out;
5087 if ((status = decode_lookup(&xdr)) != 0) 5086 status = decode_lookup(xdr);
5087 if (status)
5088 goto out; 5088 goto out;
5089 if ((status = decode_getfh(&xdr, res->fh)) != 0) 5089 status = decode_getfh(xdr, res->fh);
5090 if (status)
5090 goto out; 5091 goto out;
5091 status = decode_getfattr(&xdr, res->fattr, res->server 5092 status = decode_getfattr(xdr, res->fattr, res->server
5092 ,!RPC_IS_ASYNC(rqstp->rq_task)); 5093 ,!RPC_IS_ASYNC(rqstp->rq_task));
5093out: 5094out:
5094 return status; 5095 return status;
@@ -5097,23 +5098,25 @@ out:
5097/* 5098/*
5098 * Decode LOOKUP_ROOT response 5099 * Decode LOOKUP_ROOT response
5099 */ 5100 */
5100static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_lookup_res *res) 5101static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp,
5102 struct xdr_stream *xdr,
5103 struct nfs4_lookup_res *res)
5101{ 5104{
5102 struct xdr_stream xdr;
5103 struct compound_hdr hdr; 5105 struct compound_hdr hdr;
5104 int status; 5106 int status;
5105 5107
5106 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5108 status = decode_compound_hdr(xdr, &hdr);
5107 status = decode_compound_hdr(&xdr, &hdr);
5108 if (status) 5109 if (status)
5109 goto out; 5110 goto out;
5110 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5111 status = decode_sequence(xdr, &res->seq_res, rqstp);
5111 if (status) 5112 if (status)
5112 goto out; 5113 goto out;
5113 if ((status = decode_putrootfh(&xdr)) != 0) 5114 status = decode_putrootfh(xdr);
5115 if (status)
5114 goto out; 5116 goto out;
5115 if ((status = decode_getfh(&xdr, res->fh)) == 0) 5117 status = decode_getfh(xdr, res->fh);
5116 status = decode_getfattr(&xdr, res->fattr, res->server, 5118 if (status == 0)
5119 status = decode_getfattr(xdr, res->fattr, res->server,
5117 !RPC_IS_ASYNC(rqstp->rq_task)); 5120 !RPC_IS_ASYNC(rqstp->rq_task));
5118out: 5121out:
5119 return status; 5122 return status;
@@ -5122,24 +5125,25 @@ out:
5122/* 5125/*
5123 * Decode REMOVE response 5126 * Decode REMOVE response
5124 */ 5127 */
5125static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, __be32 *p, struct nfs_removeres *res) 5128static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5129 struct nfs_removeres *res)
5126{ 5130{
5127 struct xdr_stream xdr;
5128 struct compound_hdr hdr; 5131 struct compound_hdr hdr;
5129 int status; 5132 int status;
5130 5133
5131 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5134 status = decode_compound_hdr(xdr, &hdr);
5132 status = decode_compound_hdr(&xdr, &hdr);
5133 if (status) 5135 if (status)
5134 goto out; 5136 goto out;
5135 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5137 status = decode_sequence(xdr, &res->seq_res, rqstp);
5136 if (status) 5138 if (status)
5137 goto out; 5139 goto out;
5138 if ((status = decode_putfh(&xdr)) != 0) 5140 status = decode_putfh(xdr);
5141 if (status)
5139 goto out; 5142 goto out;
5140 if ((status = decode_remove(&xdr, &res->cinfo)) != 0) 5143 status = decode_remove(xdr, &res->cinfo);
5144 if (status)
5141 goto out; 5145 goto out;
5142 decode_getfattr(&xdr, res->dir_attr, res->server, 5146 decode_getfattr(xdr, res->dir_attr, res->server,
5143 !RPC_IS_ASYNC(rqstp->rq_task)); 5147 !RPC_IS_ASYNC(rqstp->rq_task));
5144out: 5148out:
5145 return status; 5149 return status;
@@ -5148,34 +5152,38 @@ out:
5148/* 5152/*
5149 * Decode RENAME response 5153 * Decode RENAME response
5150 */ 5154 */
5151static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, __be32 *p, struct nfs_renameres *res) 5155static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5156 struct nfs_renameres *res)
5152{ 5157{
5153 struct xdr_stream xdr;
5154 struct compound_hdr hdr; 5158 struct compound_hdr hdr;
5155 int status; 5159 int status;
5156 5160
5157 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5161 status = decode_compound_hdr(xdr, &hdr);
5158 status = decode_compound_hdr(&xdr, &hdr);
5159 if (status) 5162 if (status)
5160 goto out; 5163 goto out;
5161 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5164 status = decode_sequence(xdr, &res->seq_res, rqstp);
5162 if (status) 5165 if (status)
5163 goto out; 5166 goto out;
5164 if ((status = decode_putfh(&xdr)) != 0) 5167 status = decode_putfh(xdr);
5168 if (status)
5165 goto out; 5169 goto out;
5166 if ((status = decode_savefh(&xdr)) != 0) 5170 status = decode_savefh(xdr);
5171 if (status)
5167 goto out; 5172 goto out;
5168 if ((status = decode_putfh(&xdr)) != 0) 5173 status = decode_putfh(xdr);
5174 if (status)
5169 goto out; 5175 goto out;
5170 if ((status = decode_rename(&xdr, &res->old_cinfo, &res->new_cinfo)) != 0) 5176 status = decode_rename(xdr, &res->old_cinfo, &res->new_cinfo);
5177 if (status)
5171 goto out; 5178 goto out;
5172 /* Current FH is target directory */ 5179 /* Current FH is target directory */
5173 if (decode_getfattr(&xdr, res->new_fattr, res->server, 5180 if (decode_getfattr(xdr, res->new_fattr, res->server,
5174 !RPC_IS_ASYNC(rqstp->rq_task)) != 0) 5181 !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
5175 goto out; 5182 goto out;
5176 if ((status = decode_restorefh(&xdr)) != 0) 5183 status = decode_restorefh(xdr);
5184 if (status)
5177 goto out; 5185 goto out;
5178 decode_getfattr(&xdr, res->old_fattr, res->server, 5186 decode_getfattr(xdr, res->old_fattr, res->server,
5179 !RPC_IS_ASYNC(rqstp->rq_task)); 5187 !RPC_IS_ASYNC(rqstp->rq_task));
5180out: 5188out:
5181 return status; 5189 return status;
@@ -5184,37 +5192,41 @@ out:
5184/* 5192/*
5185 * Decode LINK response 5193 * Decode LINK response
5186 */ 5194 */
5187static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_link_res *res) 5195static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5196 struct nfs4_link_res *res)
5188{ 5197{
5189 struct xdr_stream xdr;
5190 struct compound_hdr hdr; 5198 struct compound_hdr hdr;
5191 int status; 5199 int status;
5192 5200
5193 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5201 status = decode_compound_hdr(xdr, &hdr);
5194 status = decode_compound_hdr(&xdr, &hdr);
5195 if (status) 5202 if (status)
5196 goto out; 5203 goto out;
5197 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5204 status = decode_sequence(xdr, &res->seq_res, rqstp);
5198 if (status) 5205 if (status)
5199 goto out; 5206 goto out;
5200 if ((status = decode_putfh(&xdr)) != 0) 5207 status = decode_putfh(xdr);
5208 if (status)
5201 goto out; 5209 goto out;
5202 if ((status = decode_savefh(&xdr)) != 0) 5210 status = decode_savefh(xdr);
5211 if (status)
5203 goto out; 5212 goto out;
5204 if ((status = decode_putfh(&xdr)) != 0) 5213 status = decode_putfh(xdr);
5214 if (status)
5205 goto out; 5215 goto out;
5206 if ((status = decode_link(&xdr, &res->cinfo)) != 0) 5216 status = decode_link(xdr, &res->cinfo);
5217 if (status)
5207 goto out; 5218 goto out;
5208 /* 5219 /*
5209 * Note order: OP_LINK leaves the directory as the current 5220 * Note order: OP_LINK leaves the directory as the current
5210 * filehandle. 5221 * filehandle.
5211 */ 5222 */
5212 if (decode_getfattr(&xdr, res->dir_attr, res->server, 5223 if (decode_getfattr(xdr, res->dir_attr, res->server,
5213 !RPC_IS_ASYNC(rqstp->rq_task)) != 0) 5224 !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
5214 goto out; 5225 goto out;
5215 if ((status = decode_restorefh(&xdr)) != 0) 5226 status = decode_restorefh(xdr);
5227 if (status)
5216 goto out; 5228 goto out;
5217 decode_getfattr(&xdr, res->fattr, res->server, 5229 decode_getfattr(xdr, res->fattr, res->server,
5218 !RPC_IS_ASYNC(rqstp->rq_task)); 5230 !RPC_IS_ASYNC(rqstp->rq_task));
5219out: 5231out:
5220 return status; 5232 return status;
@@ -5223,33 +5235,37 @@ out:
5223/* 5235/*
5224 * Decode CREATE response 5236 * Decode CREATE response
5225 */ 5237 */
5226static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_create_res *res) 5238static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5239 struct nfs4_create_res *res)
5227{ 5240{
5228 struct xdr_stream xdr;
5229 struct compound_hdr hdr; 5241 struct compound_hdr hdr;
5230 int status; 5242 int status;
5231 5243
5232 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5244 status = decode_compound_hdr(xdr, &hdr);
5233 status = decode_compound_hdr(&xdr, &hdr);
5234 if (status) 5245 if (status)
5235 goto out; 5246 goto out;
5236 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5247 status = decode_sequence(xdr, &res->seq_res, rqstp);
5237 if (status) 5248 if (status)
5238 goto out; 5249 goto out;
5239 if ((status = decode_putfh(&xdr)) != 0) 5250 status = decode_putfh(xdr);
5251 if (status)
5240 goto out; 5252 goto out;
5241 if ((status = decode_savefh(&xdr)) != 0) 5253 status = decode_savefh(xdr);
5254 if (status)
5242 goto out; 5255 goto out;
5243 if ((status = decode_create(&xdr,&res->dir_cinfo)) != 0) 5256 status = decode_create(xdr, &res->dir_cinfo);
5257 if (status)
5244 goto out; 5258 goto out;
5245 if ((status = decode_getfh(&xdr, res->fh)) != 0) 5259 status = decode_getfh(xdr, res->fh);
5260 if (status)
5246 goto out; 5261 goto out;
5247 if (decode_getfattr(&xdr, res->fattr, res->server, 5262 if (decode_getfattr(xdr, res->fattr, res->server,
5248 !RPC_IS_ASYNC(rqstp->rq_task)) != 0) 5263 !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
5249 goto out; 5264 goto out;
5250 if ((status = decode_restorefh(&xdr)) != 0) 5265 status = decode_restorefh(xdr);
5266 if (status)
5251 goto out; 5267 goto out;
5252 decode_getfattr(&xdr, res->dir_fattr, res->server, 5268 decode_getfattr(xdr, res->dir_fattr, res->server,
5253 !RPC_IS_ASYNC(rqstp->rq_task)); 5269 !RPC_IS_ASYNC(rqstp->rq_task));
5254out: 5270out:
5255 return status; 5271 return status;
@@ -5258,31 +5274,31 @@ out:
5258/* 5274/*
5259 * Decode SYMLINK response 5275 * Decode SYMLINK response
5260 */ 5276 */
5261static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_create_res *res) 5277static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5278 struct nfs4_create_res *res)
5262{ 5279{
5263 return nfs4_xdr_dec_create(rqstp, p, res); 5280 return nfs4_xdr_dec_create(rqstp, xdr, res);
5264} 5281}
5265 5282
5266/* 5283/*
5267 * Decode GETATTR response 5284 * Decode GETATTR response
5268 */ 5285 */
5269static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_getattr_res *res) 5286static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5287 struct nfs4_getattr_res *res)
5270{ 5288{
5271 struct xdr_stream xdr;
5272 struct compound_hdr hdr; 5289 struct compound_hdr hdr;
5273 int status; 5290 int status;
5274 5291
5275 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5292 status = decode_compound_hdr(xdr, &hdr);
5276 status = decode_compound_hdr(&xdr, &hdr);
5277 if (status) 5293 if (status)
5278 goto out; 5294 goto out;
5279 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5295 status = decode_sequence(xdr, &res->seq_res, rqstp);
5280 if (status) 5296 if (status)
5281 goto out; 5297 goto out;
5282 status = decode_putfh(&xdr); 5298 status = decode_putfh(xdr);
5283 if (status) 5299 if (status)
5284 goto out; 5300 goto out;
5285 status = decode_getfattr(&xdr, res->fattr, res->server, 5301 status = decode_getfattr(xdr, res->fattr, res->server,
5286 !RPC_IS_ASYNC(rqstp->rq_task)); 5302 !RPC_IS_ASYNC(rqstp->rq_task));
5287out: 5303out:
5288 return status; 5304 return status;
@@ -5309,24 +5325,22 @@ static void nfs4_xdr_enc_setacl(struct rpc_rqst *req, struct xdr_stream *xdr,
5309 * Decode SETACL response 5325 * Decode SETACL response
5310 */ 5326 */
5311static int 5327static int
5312nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, __be32 *p, 5328nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5313 struct nfs_setaclres *res) 5329 struct nfs_setaclres *res)
5314{ 5330{
5315 struct xdr_stream xdr;
5316 struct compound_hdr hdr; 5331 struct compound_hdr hdr;
5317 int status; 5332 int status;
5318 5333
5319 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5334 status = decode_compound_hdr(xdr, &hdr);
5320 status = decode_compound_hdr(&xdr, &hdr);
5321 if (status) 5335 if (status)
5322 goto out; 5336 goto out;
5323 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5337 status = decode_sequence(xdr, &res->seq_res, rqstp);
5324 if (status) 5338 if (status)
5325 goto out; 5339 goto out;
5326 status = decode_putfh(&xdr); 5340 status = decode_putfh(xdr);
5327 if (status) 5341 if (status)
5328 goto out; 5342 goto out;
5329 status = decode_setattr(&xdr); 5343 status = decode_setattr(xdr);
5330out: 5344out:
5331 return status; 5345 return status;
5332} 5346}
@@ -5335,24 +5349,22 @@ out:
5335 * Decode GETACL response 5349 * Decode GETACL response
5336 */ 5350 */
5337static int 5351static int
5338nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, __be32 *p, 5352nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5339 struct nfs_getaclres *res) 5353 struct nfs_getaclres *res)
5340{ 5354{
5341 struct xdr_stream xdr;
5342 struct compound_hdr hdr; 5355 struct compound_hdr hdr;
5343 int status; 5356 int status;
5344 5357
5345 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5358 status = decode_compound_hdr(xdr, &hdr);
5346 status = decode_compound_hdr(&xdr, &hdr);
5347 if (status) 5359 if (status)
5348 goto out; 5360 goto out;
5349 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5361 status = decode_sequence(xdr, &res->seq_res, rqstp);
5350 if (status) 5362 if (status)
5351 goto out; 5363 goto out;
5352 status = decode_putfh(&xdr); 5364 status = decode_putfh(xdr);
5353 if (status) 5365 if (status)
5354 goto out; 5366 goto out;
5355 status = decode_getacl(&xdr, rqstp, &res->acl_len); 5367 status = decode_getacl(xdr, rqstp, &res->acl_len);
5356 5368
5357out: 5369out:
5358 return status; 5370 return status;
@@ -5361,23 +5373,22 @@ out:
5361/* 5373/*
5362 * Decode CLOSE response 5374 * Decode CLOSE response
5363 */ 5375 */
5364static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, __be32 *p, struct nfs_closeres *res) 5376static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5377 struct nfs_closeres *res)
5365{ 5378{
5366 struct xdr_stream xdr;
5367 struct compound_hdr hdr; 5379 struct compound_hdr hdr;
5368 int status; 5380 int status;
5369 5381
5370 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5382 status = decode_compound_hdr(xdr, &hdr);
5371 status = decode_compound_hdr(&xdr, &hdr);
5372 if (status) 5383 if (status)
5373 goto out; 5384 goto out;
5374 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5385 status = decode_sequence(xdr, &res->seq_res, rqstp);
5375 if (status) 5386 if (status)
5376 goto out; 5387 goto out;
5377 status = decode_putfh(&xdr); 5388 status = decode_putfh(xdr);
5378 if (status) 5389 if (status)
5379 goto out; 5390 goto out;
5380 status = decode_close(&xdr, res); 5391 status = decode_close(xdr, res);
5381 if (status != 0) 5392 if (status != 0)
5382 goto out; 5393 goto out;
5383 /* 5394 /*
@@ -5386,7 +5397,7 @@ static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, __be32 *p, struct nfs_clos
5386 * an ESTALE error. Shouldn't be a problem, 5397 * an ESTALE error. Shouldn't be a problem,
5387 * though, since fattr->valid will remain unset. 5398 * though, since fattr->valid will remain unset.
5388 */ 5399 */
5389 decode_getfattr(&xdr, res->fattr, res->server, 5400 decode_getfattr(xdr, res->fattr, res->server,
5390 !RPC_IS_ASYNC(rqstp->rq_task)); 5401 !RPC_IS_ASYNC(rqstp->rq_task));
5391out: 5402out:
5392 return status; 5403 return status;
@@ -5395,36 +5406,35 @@ out:
5395/* 5406/*
5396 * Decode OPEN response 5407 * Decode OPEN response
5397 */ 5408 */
5398static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, __be32 *p, struct nfs_openres *res) 5409static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5410 struct nfs_openres *res)
5399{ 5411{
5400 struct xdr_stream xdr;
5401 struct compound_hdr hdr; 5412 struct compound_hdr hdr;
5402 int status; 5413 int status;
5403 5414
5404 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5415 status = decode_compound_hdr(xdr, &hdr);
5405 status = decode_compound_hdr(&xdr, &hdr);
5406 if (status) 5416 if (status)
5407 goto out; 5417 goto out;
5408 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5418 status = decode_sequence(xdr, &res->seq_res, rqstp);
5409 if (status) 5419 if (status)
5410 goto out; 5420 goto out;
5411 status = decode_putfh(&xdr); 5421 status = decode_putfh(xdr);
5412 if (status) 5422 if (status)
5413 goto out; 5423 goto out;
5414 status = decode_savefh(&xdr); 5424 status = decode_savefh(xdr);
5415 if (status) 5425 if (status)
5416 goto out; 5426 goto out;
5417 status = decode_open(&xdr, res); 5427 status = decode_open(xdr, res);
5418 if (status) 5428 if (status)
5419 goto out; 5429 goto out;
5420 if (decode_getfh(&xdr, &res->fh) != 0) 5430 if (decode_getfh(xdr, &res->fh) != 0)
5421 goto out; 5431 goto out;
5422 if (decode_getfattr(&xdr, res->f_attr, res->server, 5432 if (decode_getfattr(xdr, res->f_attr, res->server,
5423 !RPC_IS_ASYNC(rqstp->rq_task)) != 0) 5433 !RPC_IS_ASYNC(rqstp->rq_task)) != 0)
5424 goto out; 5434 goto out;
5425 if (decode_restorefh(&xdr) != 0) 5435 if (decode_restorefh(xdr) != 0)
5426 goto out; 5436 goto out;
5427 decode_getfattr(&xdr, res->dir_attr, res->server, 5437 decode_getfattr(xdr, res->dir_attr, res->server,
5428 !RPC_IS_ASYNC(rqstp->rq_task)); 5438 !RPC_IS_ASYNC(rqstp->rq_task));
5429out: 5439out:
5430 return status; 5440 return status;
@@ -5433,20 +5443,20 @@ out:
5433/* 5443/*
5434 * Decode OPEN_CONFIRM response 5444 * Decode OPEN_CONFIRM response
5435 */ 5445 */
5436static int nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, __be32 *p, struct nfs_open_confirmres *res) 5446static int nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp,
5447 struct xdr_stream *xdr,
5448 struct nfs_open_confirmres *res)
5437{ 5449{
5438 struct xdr_stream xdr;
5439 struct compound_hdr hdr; 5450 struct compound_hdr hdr;
5440 int status; 5451 int status;
5441 5452
5442 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5453 status = decode_compound_hdr(xdr, &hdr);
5443 status = decode_compound_hdr(&xdr, &hdr);
5444 if (status) 5454 if (status)
5445 goto out; 5455 goto out;
5446 status = decode_putfh(&xdr); 5456 status = decode_putfh(xdr);
5447 if (status) 5457 if (status)
5448 goto out; 5458 goto out;
5449 status = decode_open_confirm(&xdr, res); 5459 status = decode_open_confirm(xdr, res);
5450out: 5460out:
5451 return status; 5461 return status;
5452} 5462}
@@ -5454,26 +5464,26 @@ out:
5454/* 5464/*
5455 * Decode OPEN response 5465 * Decode OPEN response
5456 */ 5466 */
5457static int nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs_openres *res) 5467static int nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp,
5468 struct xdr_stream *xdr,
5469 struct nfs_openres *res)
5458{ 5470{
5459 struct xdr_stream xdr;
5460 struct compound_hdr hdr; 5471 struct compound_hdr hdr;
5461 int status; 5472 int status;
5462 5473
5463 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5474 status = decode_compound_hdr(xdr, &hdr);
5464 status = decode_compound_hdr(&xdr, &hdr);
5465 if (status) 5475 if (status)
5466 goto out; 5476 goto out;
5467 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5477 status = decode_sequence(xdr, &res->seq_res, rqstp);
5468 if (status) 5478 if (status)
5469 goto out; 5479 goto out;
5470 status = decode_putfh(&xdr); 5480 status = decode_putfh(xdr);
5471 if (status) 5481 if (status)
5472 goto out; 5482 goto out;
5473 status = decode_open(&xdr, res); 5483 status = decode_open(xdr, res);
5474 if (status) 5484 if (status)
5475 goto out; 5485 goto out;
5476 decode_getfattr(&xdr, res->f_attr, res->server, 5486 decode_getfattr(xdr, res->f_attr, res->server,
5477 !RPC_IS_ASYNC(rqstp->rq_task)); 5487 !RPC_IS_ASYNC(rqstp->rq_task));
5478out: 5488out:
5479 return status; 5489 return status;
@@ -5482,26 +5492,26 @@ out:
5482/* 5492/*
5483 * Decode SETATTR response 5493 * Decode SETATTR response
5484 */ 5494 */
5485static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs_setattrres *res) 5495static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp,
5496 struct xdr_stream *xdr,
5497 struct nfs_setattrres *res)
5486{ 5498{
5487 struct xdr_stream xdr;
5488 struct compound_hdr hdr; 5499 struct compound_hdr hdr;
5489 int status; 5500 int status;
5490 5501
5491 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5502 status = decode_compound_hdr(xdr, &hdr);
5492 status = decode_compound_hdr(&xdr, &hdr);
5493 if (status) 5503 if (status)
5494 goto out; 5504 goto out;
5495 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5505 status = decode_sequence(xdr, &res->seq_res, rqstp);
5496 if (status) 5506 if (status)
5497 goto out; 5507 goto out;
5498 status = decode_putfh(&xdr); 5508 status = decode_putfh(xdr);
5499 if (status) 5509 if (status)
5500 goto out; 5510 goto out;
5501 status = decode_setattr(&xdr); 5511 status = decode_setattr(xdr);
5502 if (status) 5512 if (status)
5503 goto out; 5513 goto out;
5504 decode_getfattr(&xdr, res->fattr, res->server, 5514 decode_getfattr(xdr, res->fattr, res->server,
5505 !RPC_IS_ASYNC(rqstp->rq_task)); 5515 !RPC_IS_ASYNC(rqstp->rq_task));
5506out: 5516out:
5507 return status; 5517 return status;
@@ -5510,23 +5520,22 @@ out:
5510/* 5520/*
5511 * Decode LOCK response 5521 * Decode LOCK response
5512 */ 5522 */
5513static int nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, __be32 *p, struct nfs_lock_res *res) 5523static int nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5524 struct nfs_lock_res *res)
5514{ 5525{
5515 struct xdr_stream xdr;
5516 struct compound_hdr hdr; 5526 struct compound_hdr hdr;
5517 int status; 5527 int status;
5518 5528
5519 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5529 status = decode_compound_hdr(xdr, &hdr);
5520 status = decode_compound_hdr(&xdr, &hdr);
5521 if (status) 5530 if (status)
5522 goto out; 5531 goto out;
5523 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5532 status = decode_sequence(xdr, &res->seq_res, rqstp);
5524 if (status) 5533 if (status)
5525 goto out; 5534 goto out;
5526 status = decode_putfh(&xdr); 5535 status = decode_putfh(xdr);
5527 if (status) 5536 if (status)
5528 goto out; 5537 goto out;
5529 status = decode_lock(&xdr, res); 5538 status = decode_lock(xdr, res);
5530out: 5539out:
5531 return status; 5540 return status;
5532} 5541}
@@ -5534,23 +5543,22 @@ out:
5534/* 5543/*
5535 * Decode LOCKT response 5544 * Decode LOCKT response
5536 */ 5545 */
5537static int nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, __be32 *p, struct nfs_lockt_res *res) 5546static int nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5547 struct nfs_lockt_res *res)
5538{ 5548{
5539 struct xdr_stream xdr;
5540 struct compound_hdr hdr; 5549 struct compound_hdr hdr;
5541 int status; 5550 int status;
5542 5551
5543 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5552 status = decode_compound_hdr(xdr, &hdr);
5544 status = decode_compound_hdr(&xdr, &hdr);
5545 if (status) 5553 if (status)
5546 goto out; 5554 goto out;
5547 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5555 status = decode_sequence(xdr, &res->seq_res, rqstp);
5548 if (status) 5556 if (status)
5549 goto out; 5557 goto out;
5550 status = decode_putfh(&xdr); 5558 status = decode_putfh(xdr);
5551 if (status) 5559 if (status)
5552 goto out; 5560 goto out;
5553 status = decode_lockt(&xdr, res); 5561 status = decode_lockt(xdr, res);
5554out: 5562out:
5555 return status; 5563 return status;
5556} 5564}
@@ -5558,61 +5566,58 @@ out:
5558/* 5566/*
5559 * Decode LOCKU response 5567 * Decode LOCKU response
5560 */ 5568 */
5561static int nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, __be32 *p, struct nfs_locku_res *res) 5569static int nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5570 struct nfs_locku_res *res)
5562{ 5571{
5563 struct xdr_stream xdr;
5564 struct compound_hdr hdr; 5572 struct compound_hdr hdr;
5565 int status; 5573 int status;
5566 5574
5567 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5575 status = decode_compound_hdr(xdr, &hdr);
5568 status = decode_compound_hdr(&xdr, &hdr);
5569 if (status) 5576 if (status)
5570 goto out; 5577 goto out;
5571 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5578 status = decode_sequence(xdr, &res->seq_res, rqstp);
5572 if (status) 5579 if (status)
5573 goto out; 5580 goto out;
5574 status = decode_putfh(&xdr); 5581 status = decode_putfh(xdr);
5575 if (status) 5582 if (status)
5576 goto out; 5583 goto out;
5577 status = decode_locku(&xdr, res); 5584 status = decode_locku(xdr, res);
5578out: 5585out:
5579 return status; 5586 return status;
5580} 5587}
5581 5588
5582static int nfs4_xdr_dec_release_lockowner(struct rpc_rqst *rqstp, __be32 *p, void *dummy) 5589static int nfs4_xdr_dec_release_lockowner(struct rpc_rqst *rqstp,
5590 struct xdr_stream *xdr, void *dummy)
5583{ 5591{
5584 struct xdr_stream xdr;
5585 struct compound_hdr hdr; 5592 struct compound_hdr hdr;
5586 int status; 5593 int status;
5587 5594
5588 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5595 status = decode_compound_hdr(xdr, &hdr);
5589 status = decode_compound_hdr(&xdr, &hdr);
5590 if (!status) 5596 if (!status)
5591 status = decode_release_lockowner(&xdr); 5597 status = decode_release_lockowner(xdr);
5592 return status; 5598 return status;
5593} 5599}
5594 5600
5595/* 5601/*
5596 * Decode READLINK response 5602 * Decode READLINK response
5597 */ 5603 */
5598static int nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp, __be32 *p, 5604static int nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp,
5605 struct xdr_stream *xdr,
5599 struct nfs4_readlink_res *res) 5606 struct nfs4_readlink_res *res)
5600{ 5607{
5601 struct xdr_stream xdr;
5602 struct compound_hdr hdr; 5608 struct compound_hdr hdr;
5603 int status; 5609 int status;
5604 5610
5605 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5611 status = decode_compound_hdr(xdr, &hdr);
5606 status = decode_compound_hdr(&xdr, &hdr);
5607 if (status) 5612 if (status)
5608 goto out; 5613 goto out;
5609 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5614 status = decode_sequence(xdr, &res->seq_res, rqstp);
5610 if (status) 5615 if (status)
5611 goto out; 5616 goto out;
5612 status = decode_putfh(&xdr); 5617 status = decode_putfh(xdr);
5613 if (status) 5618 if (status)
5614 goto out; 5619 goto out;
5615 status = decode_readlink(&xdr, rqstp); 5620 status = decode_readlink(xdr, rqstp);
5616out: 5621out:
5617 return status; 5622 return status;
5618} 5623}
@@ -5620,23 +5625,22 @@ out:
5620/* 5625/*
5621 * Decode READDIR response 5626 * Decode READDIR response
5622 */ 5627 */
5623static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_readdir_res *res) 5628static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5629 struct nfs4_readdir_res *res)
5624{ 5630{
5625 struct xdr_stream xdr;
5626 struct compound_hdr hdr; 5631 struct compound_hdr hdr;
5627 int status; 5632 int status;
5628 5633
5629 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5634 status = decode_compound_hdr(xdr, &hdr);
5630 status = decode_compound_hdr(&xdr, &hdr);
5631 if (status) 5635 if (status)
5632 goto out; 5636 goto out;
5633 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5637 status = decode_sequence(xdr, &res->seq_res, rqstp);
5634 if (status) 5638 if (status)
5635 goto out; 5639 goto out;
5636 status = decode_putfh(&xdr); 5640 status = decode_putfh(xdr);
5637 if (status) 5641 if (status)
5638 goto out; 5642 goto out;
5639 status = decode_readdir(&xdr, rqstp, res); 5643 status = decode_readdir(xdr, rqstp, res);
5640out: 5644out:
5641 return status; 5645 return status;
5642} 5646}
@@ -5644,23 +5648,22 @@ out:
5644/* 5648/*
5645 * Decode Read response 5649 * Decode Read response
5646 */ 5650 */
5647static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, __be32 *p, struct nfs_readres *res) 5651static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5652 struct nfs_readres *res)
5648{ 5653{
5649 struct xdr_stream xdr;
5650 struct compound_hdr hdr; 5654 struct compound_hdr hdr;
5651 int status; 5655 int status;
5652 5656
5653 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5657 status = decode_compound_hdr(xdr, &hdr);
5654 status = decode_compound_hdr(&xdr, &hdr);
5655 if (status) 5658 if (status)
5656 goto out; 5659 goto out;
5657 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5660 status = decode_sequence(xdr, &res->seq_res, rqstp);
5658 if (status) 5661 if (status)
5659 goto out; 5662 goto out;
5660 status = decode_putfh(&xdr); 5663 status = decode_putfh(xdr);
5661 if (status) 5664 if (status)
5662 goto out; 5665 goto out;
5663 status = decode_read(&xdr, rqstp, res); 5666 status = decode_read(xdr, rqstp, res);
5664 if (!status) 5667 if (!status)
5665 status = res->count; 5668 status = res->count;
5666out: 5669out:
@@ -5670,26 +5673,25 @@ out:
5670/* 5673/*
5671 * Decode WRITE response 5674 * Decode WRITE response
5672 */ 5675 */
5673static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, __be32 *p, struct nfs_writeres *res) 5676static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5677 struct nfs_writeres *res)
5674{ 5678{
5675 struct xdr_stream xdr;
5676 struct compound_hdr hdr; 5679 struct compound_hdr hdr;
5677 int status; 5680 int status;
5678 5681
5679 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5682 status = decode_compound_hdr(xdr, &hdr);
5680 status = decode_compound_hdr(&xdr, &hdr);
5681 if (status) 5683 if (status)
5682 goto out; 5684 goto out;
5683 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5685 status = decode_sequence(xdr, &res->seq_res, rqstp);
5684 if (status) 5686 if (status)
5685 goto out; 5687 goto out;
5686 status = decode_putfh(&xdr); 5688 status = decode_putfh(xdr);
5687 if (status) 5689 if (status)
5688 goto out; 5690 goto out;
5689 status = decode_write(&xdr, res); 5691 status = decode_write(xdr, res);
5690 if (status) 5692 if (status)
5691 goto out; 5693 goto out;
5692 decode_getfattr(&xdr, res->fattr, res->server, 5694 decode_getfattr(xdr, res->fattr, res->server,
5693 !RPC_IS_ASYNC(rqstp->rq_task)); 5695 !RPC_IS_ASYNC(rqstp->rq_task));
5694 if (!status) 5696 if (!status)
5695 status = res->count; 5697 status = res->count;
@@ -5700,26 +5702,25 @@ out:
5700/* 5702/*
5701 * Decode COMMIT response 5703 * Decode COMMIT response
5702 */ 5704 */
5703static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, __be32 *p, struct nfs_writeres *res) 5705static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5706 struct nfs_writeres *res)
5704{ 5707{
5705 struct xdr_stream xdr;
5706 struct compound_hdr hdr; 5708 struct compound_hdr hdr;
5707 int status; 5709 int status;
5708 5710
5709 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5711 status = decode_compound_hdr(xdr, &hdr);
5710 status = decode_compound_hdr(&xdr, &hdr);
5711 if (status) 5712 if (status)
5712 goto out; 5713 goto out;
5713 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5714 status = decode_sequence(xdr, &res->seq_res, rqstp);
5714 if (status) 5715 if (status)
5715 goto out; 5716 goto out;
5716 status = decode_putfh(&xdr); 5717 status = decode_putfh(xdr);
5717 if (status) 5718 if (status)
5718 goto out; 5719 goto out;
5719 status = decode_commit(&xdr, res); 5720 status = decode_commit(xdr, res);
5720 if (status) 5721 if (status)
5721 goto out; 5722 goto out;
5722 decode_getfattr(&xdr, res->fattr, res->server, 5723 decode_getfattr(xdr, res->fattr, res->server,
5723 !RPC_IS_ASYNC(rqstp->rq_task)); 5724 !RPC_IS_ASYNC(rqstp->rq_task));
5724out: 5725out:
5725 return status; 5726 return status;
@@ -5728,85 +5729,80 @@ out:
5728/* 5729/*
5729 * Decode FSINFO response 5730 * Decode FSINFO response
5730 */ 5731 */
5731static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, __be32 *p, 5732static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, struct xdr_stream *xdr,
5732 struct nfs4_fsinfo_res *res) 5733 struct nfs4_fsinfo_res *res)
5733{ 5734{
5734 struct xdr_stream xdr;
5735 struct compound_hdr hdr; 5735 struct compound_hdr hdr;
5736 int status; 5736 int status;
5737 5737
5738 xdr_init_decode(&xdr, &req->rq_rcv_buf, p); 5738 status = decode_compound_hdr(xdr, &hdr);
5739 status = decode_compound_hdr(&xdr, &hdr);
5740 if (!status) 5739 if (!status)
5741 status = decode_sequence(&xdr, &res->seq_res, req); 5740 status = decode_sequence(xdr, &res->seq_res, req);
5742 if (!status) 5741 if (!status)
5743 status = decode_putfh(&xdr); 5742 status = decode_putfh(xdr);
5744 if (!status) 5743 if (!status)
5745 status = decode_fsinfo(&xdr, res->fsinfo); 5744 status = decode_fsinfo(xdr, res->fsinfo);
5746 return status; 5745 return status;
5747} 5746}
5748 5747
5749/* 5748/*
5750 * Decode PATHCONF response 5749 * Decode PATHCONF response
5751 */ 5750 */
5752static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, __be32 *p, 5751static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, struct xdr_stream *xdr,
5753 struct nfs4_pathconf_res *res) 5752 struct nfs4_pathconf_res *res)
5754{ 5753{
5755 struct xdr_stream xdr;
5756 struct compound_hdr hdr; 5754 struct compound_hdr hdr;
5757 int status; 5755 int status;
5758 5756
5759 xdr_init_decode(&xdr, &req->rq_rcv_buf, p); 5757 status = decode_compound_hdr(xdr, &hdr);
5760 status = decode_compound_hdr(&xdr, &hdr);
5761 if (!status) 5758 if (!status)
5762 status = decode_sequence(&xdr, &res->seq_res, req); 5759 status = decode_sequence(xdr, &res->seq_res, req);
5763 if (!status) 5760 if (!status)
5764 status = decode_putfh(&xdr); 5761 status = decode_putfh(xdr);
5765 if (!status) 5762 if (!status)
5766 status = decode_pathconf(&xdr, res->pathconf); 5763 status = decode_pathconf(xdr, res->pathconf);
5767 return status; 5764 return status;
5768} 5765}
5769 5766
5770/* 5767/*
5771 * Decode STATFS response 5768 * Decode STATFS response
5772 */ 5769 */
5773static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, __be32 *p, 5770static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, struct xdr_stream *xdr,
5774 struct nfs4_statfs_res *res) 5771 struct nfs4_statfs_res *res)
5775{ 5772{
5776 struct xdr_stream xdr;
5777 struct compound_hdr hdr; 5773 struct compound_hdr hdr;
5778 int status; 5774 int status;
5779 5775
5780 xdr_init_decode(&xdr, &req->rq_rcv_buf, p); 5776 status = decode_compound_hdr(xdr, &hdr);
5781 status = decode_compound_hdr(&xdr, &hdr);
5782 if (!status) 5777 if (!status)
5783 status = decode_sequence(&xdr, &res->seq_res, req); 5778 status = decode_sequence(xdr, &res->seq_res, req);
5784 if (!status) 5779 if (!status)
5785 status = decode_putfh(&xdr); 5780 status = decode_putfh(xdr);
5786 if (!status) 5781 if (!status)
5787 status = decode_statfs(&xdr, res->fsstat); 5782 status = decode_statfs(xdr, res->fsstat);
5788 return status; 5783 return status;
5789} 5784}
5790 5785
5791/* 5786/*
5792 * Decode GETATTR_BITMAP response 5787 * Decode GETATTR_BITMAP response
5793 */ 5788 */
5794static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req, __be32 *p, struct nfs4_server_caps_res *res) 5789static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req,
5790 struct xdr_stream *xdr,
5791 struct nfs4_server_caps_res *res)
5795{ 5792{
5796 struct xdr_stream xdr;
5797 struct compound_hdr hdr; 5793 struct compound_hdr hdr;
5798 int status; 5794 int status;
5799 5795
5800 xdr_init_decode(&xdr, &req->rq_rcv_buf, p); 5796 status = decode_compound_hdr(xdr, &hdr);
5801 status = decode_compound_hdr(&xdr, &hdr);
5802 if (status) 5797 if (status)
5803 goto out; 5798 goto out;
5804 status = decode_sequence(&xdr, &res->seq_res, req); 5799 status = decode_sequence(xdr, &res->seq_res, req);
5805 if (status) 5800 if (status)
5806 goto out; 5801 goto out;
5807 if ((status = decode_putfh(&xdr)) != 0) 5802 status = decode_putfh(xdr);
5803 if (status)
5808 goto out; 5804 goto out;
5809 status = decode_server_caps(&xdr, res); 5805 status = decode_server_caps(xdr, res);
5810out: 5806out:
5811 return status; 5807 return status;
5812} 5808}
@@ -5814,79 +5810,77 @@ out:
5814/* 5810/*
5815 * Decode RENEW response 5811 * Decode RENEW response
5816 */ 5812 */
5817static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, __be32 *p, void *dummy) 5813static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5814 void *__unused)
5818{ 5815{
5819 struct xdr_stream xdr;
5820 struct compound_hdr hdr; 5816 struct compound_hdr hdr;
5821 int status; 5817 int status;
5822 5818
5823 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5819 status = decode_compound_hdr(xdr, &hdr);
5824 status = decode_compound_hdr(&xdr, &hdr);
5825 if (!status) 5820 if (!status)
5826 status = decode_renew(&xdr); 5821 status = decode_renew(xdr);
5827 return status; 5822 return status;
5828} 5823}
5829 5824
5830/* 5825/*
5831 * Decode SETCLIENTID response 5826 * Decode SETCLIENTID response
5832 */ 5827 */
5833static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, __be32 *p, 5828static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req,
5834 struct nfs4_setclientid_res *res) 5829 struct xdr_stream *xdr,
5830 struct nfs4_setclientid_res *res)
5835{ 5831{
5836 struct xdr_stream xdr;
5837 struct compound_hdr hdr; 5832 struct compound_hdr hdr;
5838 int status; 5833 int status;
5839 5834
5840 xdr_init_decode(&xdr, &req->rq_rcv_buf, p); 5835 status = decode_compound_hdr(xdr, &hdr);
5841 status = decode_compound_hdr(&xdr, &hdr);
5842 if (!status) 5836 if (!status)
5843 status = decode_setclientid(&xdr, res); 5837 status = decode_setclientid(xdr, res);
5844 return status; 5838 return status;
5845} 5839}
5846 5840
5847/* 5841/*
5848 * Decode SETCLIENTID_CONFIRM response 5842 * Decode SETCLIENTID_CONFIRM response
5849 */ 5843 */
5850static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *fsinfo) 5844static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req,
5845 struct xdr_stream *xdr,
5846 struct nfs_fsinfo *fsinfo)
5851{ 5847{
5852 struct xdr_stream xdr;
5853 struct compound_hdr hdr; 5848 struct compound_hdr hdr;
5854 int status; 5849 int status;
5855 5850
5856 xdr_init_decode(&xdr, &req->rq_rcv_buf, p); 5851 status = decode_compound_hdr(xdr, &hdr);
5857 status = decode_compound_hdr(&xdr, &hdr);
5858 if (!status) 5852 if (!status)
5859 status = decode_setclientid_confirm(&xdr); 5853 status = decode_setclientid_confirm(xdr);
5860 if (!status) 5854 if (!status)
5861 status = decode_putrootfh(&xdr); 5855 status = decode_putrootfh(xdr);
5862 if (!status) 5856 if (!status)
5863 status = decode_fsinfo(&xdr, fsinfo); 5857 status = decode_fsinfo(xdr, fsinfo);
5864 return status; 5858 return status;
5865} 5859}
5866 5860
5867/* 5861/*
5868 * Decode DELEGRETURN response 5862 * Decode DELEGRETURN response
5869 */ 5863 */
5870static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_delegreturnres *res) 5864static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp,
5865 struct xdr_stream *xdr,
5866 struct nfs4_delegreturnres *res)
5871{ 5867{
5872 struct xdr_stream xdr;
5873 struct compound_hdr hdr; 5868 struct compound_hdr hdr;
5874 int status; 5869 int status;
5875 5870
5876 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5871 status = decode_compound_hdr(xdr, &hdr);
5877 status = decode_compound_hdr(&xdr, &hdr);
5878 if (status) 5872 if (status)
5879 goto out; 5873 goto out;
5880 status = decode_sequence(&xdr, &res->seq_res, rqstp); 5874 status = decode_sequence(xdr, &res->seq_res, rqstp);
5881 if (status) 5875 if (status)
5882 goto out; 5876 goto out;
5883 status = decode_putfh(&xdr); 5877 status = decode_putfh(xdr);
5884 if (status != 0) 5878 if (status != 0)
5885 goto out; 5879 goto out;
5886 status = decode_delegreturn(&xdr); 5880 status = decode_delegreturn(xdr);
5887 if (status != 0) 5881 if (status != 0)
5888 goto out; 5882 goto out;
5889 decode_getfattr(&xdr, res->fattr, res->server, 5883 decode_getfattr(xdr, res->fattr, res->server,
5890 !RPC_IS_ASYNC(rqstp->rq_task)); 5884 !RPC_IS_ASYNC(rqstp->rq_task));
5891out: 5885out:
5892 return status; 5886 return status;
@@ -5895,26 +5889,27 @@ out:
5895/* 5889/*
5896 * Decode FS_LOCATIONS response 5890 * Decode FS_LOCATIONS response
5897 */ 5891 */
5898static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, __be32 *p, 5892static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req,
5893 struct xdr_stream *xdr,
5899 struct nfs4_fs_locations_res *res) 5894 struct nfs4_fs_locations_res *res)
5900{ 5895{
5901 struct xdr_stream xdr;
5902 struct compound_hdr hdr; 5896 struct compound_hdr hdr;
5903 int status; 5897 int status;
5904 5898
5905 xdr_init_decode(&xdr, &req->rq_rcv_buf, p); 5899 status = decode_compound_hdr(xdr, &hdr);
5906 status = decode_compound_hdr(&xdr, &hdr);
5907 if (status) 5900 if (status)
5908 goto out; 5901 goto out;
5909 status = decode_sequence(&xdr, &res->seq_res, req); 5902 status = decode_sequence(xdr, &res->seq_res, req);
5910 if (status) 5903 if (status)
5911 goto out; 5904 goto out;
5912 if ((status = decode_putfh(&xdr)) != 0) 5905 status = decode_putfh(xdr);
5906 if (status)
5913 goto out; 5907 goto out;
5914 if ((status = decode_lookup(&xdr)) != 0) 5908 status = decode_lookup(xdr);
5909 if (status)
5915 goto out; 5910 goto out;
5916 xdr_enter_page(&xdr, PAGE_SIZE); 5911 xdr_enter_page(xdr, PAGE_SIZE);
5917 status = decode_getfattr(&xdr, &res->fs_locations->fattr, 5912 status = decode_getfattr(xdr, &res->fs_locations->fattr,
5918 res->fs_locations->server, 5913 res->fs_locations->server,
5919 !RPC_IS_ASYNC(req->rq_task)); 5914 !RPC_IS_ASYNC(req->rq_task));
5920out: 5915out:
@@ -5925,129 +5920,122 @@ out:
5925/* 5920/*
5926 * Decode EXCHANGE_ID response 5921 * Decode EXCHANGE_ID response
5927 */ 5922 */
5928static int nfs4_xdr_dec_exchange_id(struct rpc_rqst *rqstp, uint32_t *p, 5923static int nfs4_xdr_dec_exchange_id(struct rpc_rqst *rqstp,
5924 struct xdr_stream *xdr,
5929 void *res) 5925 void *res)
5930{ 5926{
5931 struct xdr_stream xdr;
5932 struct compound_hdr hdr; 5927 struct compound_hdr hdr;
5933 int status; 5928 int status;
5934 5929
5935 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5930 status = decode_compound_hdr(xdr, &hdr);
5936 status = decode_compound_hdr(&xdr, &hdr);
5937 if (!status) 5931 if (!status)
5938 status = decode_exchange_id(&xdr, res); 5932 status = decode_exchange_id(xdr, res);
5939 return status; 5933 return status;
5940} 5934}
5941 5935
5942/* 5936/*
5943 * Decode CREATE_SESSION response 5937 * Decode CREATE_SESSION response
5944 */ 5938 */
5945static int nfs4_xdr_dec_create_session(struct rpc_rqst *rqstp, uint32_t *p, 5939static int nfs4_xdr_dec_create_session(struct rpc_rqst *rqstp,
5940 struct xdr_stream *xdr,
5946 struct nfs41_create_session_res *res) 5941 struct nfs41_create_session_res *res)
5947{ 5942{
5948 struct xdr_stream xdr;
5949 struct compound_hdr hdr; 5943 struct compound_hdr hdr;
5950 int status; 5944 int status;
5951 5945
5952 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5946 status = decode_compound_hdr(xdr, &hdr);
5953 status = decode_compound_hdr(&xdr, &hdr);
5954 if (!status) 5947 if (!status)
5955 status = decode_create_session(&xdr, res); 5948 status = decode_create_session(xdr, res);
5956 return status; 5949 return status;
5957} 5950}
5958 5951
5959/* 5952/*
5960 * Decode DESTROY_SESSION response 5953 * Decode DESTROY_SESSION response
5961 */ 5954 */
5962static int nfs4_xdr_dec_destroy_session(struct rpc_rqst *rqstp, uint32_t *p, 5955static int nfs4_xdr_dec_destroy_session(struct rpc_rqst *rqstp,
5963 void *dummy) 5956 struct xdr_stream *xdr,
5957 void *res)
5964{ 5958{
5965 struct xdr_stream xdr;
5966 struct compound_hdr hdr; 5959 struct compound_hdr hdr;
5967 int status; 5960 int status;
5968 5961
5969 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5962 status = decode_compound_hdr(xdr, &hdr);
5970 status = decode_compound_hdr(&xdr, &hdr);
5971 if (!status) 5963 if (!status)
5972 status = decode_destroy_session(&xdr, dummy); 5964 status = decode_destroy_session(xdr, res);
5973 return status; 5965 return status;
5974} 5966}
5975 5967
5976/* 5968/*
5977 * Decode SEQUENCE response 5969 * Decode SEQUENCE response
5978 */ 5970 */
5979static int nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp, uint32_t *p, 5971static int nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp,
5972 struct xdr_stream *xdr,
5980 struct nfs4_sequence_res *res) 5973 struct nfs4_sequence_res *res)
5981{ 5974{
5982 struct xdr_stream xdr;
5983 struct compound_hdr hdr; 5975 struct compound_hdr hdr;
5984 int status; 5976 int status;
5985 5977
5986 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5978 status = decode_compound_hdr(xdr, &hdr);
5987 status = decode_compound_hdr(&xdr, &hdr);
5988 if (!status) 5979 if (!status)
5989 status = decode_sequence(&xdr, res, rqstp); 5980 status = decode_sequence(xdr, res, rqstp);
5990 return status; 5981 return status;
5991} 5982}
5992 5983
5993/* 5984/*
5994 * Decode GET_LEASE_TIME response 5985 * Decode GET_LEASE_TIME response
5995 */ 5986 */
5996static int nfs4_xdr_dec_get_lease_time(struct rpc_rqst *rqstp, uint32_t *p, 5987static int nfs4_xdr_dec_get_lease_time(struct rpc_rqst *rqstp,
5988 struct xdr_stream *xdr,
5997 struct nfs4_get_lease_time_res *res) 5989 struct nfs4_get_lease_time_res *res)
5998{ 5990{
5999 struct xdr_stream xdr;
6000 struct compound_hdr hdr; 5991 struct compound_hdr hdr;
6001 int status; 5992 int status;
6002 5993
6003 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 5994 status = decode_compound_hdr(xdr, &hdr);
6004 status = decode_compound_hdr(&xdr, &hdr);
6005 if (!status) 5995 if (!status)
6006 status = decode_sequence(&xdr, &res->lr_seq_res, rqstp); 5996 status = decode_sequence(xdr, &res->lr_seq_res, rqstp);
6007 if (!status) 5997 if (!status)
6008 status = decode_putrootfh(&xdr); 5998 status = decode_putrootfh(xdr);
6009 if (!status) 5999 if (!status)
6010 status = decode_fsinfo(&xdr, res->lr_fsinfo); 6000 status = decode_fsinfo(xdr, res->lr_fsinfo);
6011 return status; 6001 return status;
6012} 6002}
6013 6003
6014/* 6004/*
6015 * Decode RECLAIM_COMPLETE response 6005 * Decode RECLAIM_COMPLETE response
6016 */ 6006 */
6017static int nfs4_xdr_dec_reclaim_complete(struct rpc_rqst *rqstp, uint32_t *p, 6007static int nfs4_xdr_dec_reclaim_complete(struct rpc_rqst *rqstp,
6008 struct xdr_stream *xdr,
6018 struct nfs41_reclaim_complete_res *res) 6009 struct nfs41_reclaim_complete_res *res)
6019{ 6010{
6020 struct xdr_stream xdr;
6021 struct compound_hdr hdr; 6011 struct compound_hdr hdr;
6022 int status; 6012 int status;
6023 6013
6024 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 6014 status = decode_compound_hdr(xdr, &hdr);
6025 status = decode_compound_hdr(&xdr, &hdr);
6026 if (!status) 6015 if (!status)
6027 status = decode_sequence(&xdr, &res->seq_res, rqstp); 6016 status = decode_sequence(xdr, &res->seq_res, rqstp);
6028 if (!status) 6017 if (!status)
6029 status = decode_reclaim_complete(&xdr, (void *)NULL); 6018 status = decode_reclaim_complete(xdr, (void *)NULL);
6030 return status; 6019 return status;
6031} 6020}
6032 6021
6033/* 6022/*
6034 * Decode GETDEVINFO response 6023 * Decode GETDEVINFO response
6035 */ 6024 */
6036static int nfs4_xdr_dec_getdeviceinfo(struct rpc_rqst *rqstp, uint32_t *p, 6025static int nfs4_xdr_dec_getdeviceinfo(struct rpc_rqst *rqstp,
6026 struct xdr_stream *xdr,
6037 struct nfs4_getdeviceinfo_res *res) 6027 struct nfs4_getdeviceinfo_res *res)
6038{ 6028{
6039 struct xdr_stream xdr;
6040 struct compound_hdr hdr; 6029 struct compound_hdr hdr;
6041 int status; 6030 int status;
6042 6031
6043 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 6032 status = decode_compound_hdr(xdr, &hdr);
6044 status = decode_compound_hdr(&xdr, &hdr);
6045 if (status != 0) 6033 if (status != 0)
6046 goto out; 6034 goto out;
6047 status = decode_sequence(&xdr, &res->seq_res, rqstp); 6035 status = decode_sequence(xdr, &res->seq_res, rqstp);
6048 if (status != 0) 6036 if (status != 0)
6049 goto out; 6037 goto out;
6050 status = decode_getdeviceinfo(&xdr, res->pdev); 6038 status = decode_getdeviceinfo(xdr, res->pdev);
6051out: 6039out:
6052 return status; 6040 return status;
6053} 6041}
@@ -6055,24 +6043,23 @@ out:
6055/* 6043/*
6056 * Decode LAYOUTGET response 6044 * Decode LAYOUTGET response
6057 */ 6045 */
6058static int nfs4_xdr_dec_layoutget(struct rpc_rqst *rqstp, uint32_t *p, 6046static int nfs4_xdr_dec_layoutget(struct rpc_rqst *rqstp,
6047 struct xdr_stream *xdr,
6059 struct nfs4_layoutget_res *res) 6048 struct nfs4_layoutget_res *res)
6060{ 6049{
6061 struct xdr_stream xdr;
6062 struct compound_hdr hdr; 6050 struct compound_hdr hdr;
6063 int status; 6051 int status;
6064 6052
6065 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p); 6053 status = decode_compound_hdr(xdr, &hdr);
6066 status = decode_compound_hdr(&xdr, &hdr);
6067 if (status) 6054 if (status)
6068 goto out; 6055 goto out;
6069 status = decode_sequence(&xdr, &res->seq_res, rqstp); 6056 status = decode_sequence(xdr, &res->seq_res, rqstp);
6070 if (status) 6057 if (status)
6071 goto out; 6058 goto out;
6072 status = decode_putfh(&xdr); 6059 status = decode_putfh(xdr);
6073 if (status) 6060 if (status)
6074 goto out; 6061 goto out;
6075 status = decode_layoutget(&xdr, rqstp, res); 6062 status = decode_layoutget(xdr, rqstp, res);
6076out: 6063out:
6077 return status; 6064 return status;
6078} 6065}
@@ -6236,7 +6223,7 @@ nfs4_stat_to_errno(int stat)
6236[NFSPROC4_CLNT_##proc] = { \ 6223[NFSPROC4_CLNT_##proc] = { \
6237 .p_proc = NFSPROC4_COMPOUND, \ 6224 .p_proc = NFSPROC4_COMPOUND, \
6238 .p_encode = (kxdreproc_t)nfs4_xdr_##argtype, \ 6225 .p_encode = (kxdreproc_t)nfs4_xdr_##argtype, \
6239 .p_decode = (kxdrproc_t)nfs4_xdr_##restype, \ 6226 .p_decode = (kxdrdproc_t)nfs4_xdr_##restype, \
6240 .p_arglen = NFS4_##argtype##_sz, \ 6227 .p_arglen = NFS4_##argtype##_sz, \
6241 .p_replen = NFS4_##restype##_sz, \ 6228 .p_replen = NFS4_##restype##_sz, \
6242 .p_statidx = NFSPROC4_CLNT_##proc, \ 6229 .p_statidx = NFSPROC4_CLNT_##proc, \