@@ -1016,12 +1016,11 @@ static void encode_compound_hdr(struct xdr_stream *xdr,
10161016 struct compound_hdr * hdr )
10171017{
10181018 __be32 * p ;
1019- struct rpc_auth * auth = req -> rq_cred -> cr_auth ;
10201019
10211020 /* initialize running count of expected bytes in reply.
10221021 * NOTE: the replied tag SHOULD be the same is the one sent,
10231022 * but this is not required as a MUST for the server to do so. */
1024- hdr -> replen = RPC_REPHDRSIZE + auth -> au_rslack + 3 + hdr -> taglen ;
1023+ hdr -> replen = 3 + hdr -> taglen ;
10251024
10261025 WARN_ON_ONCE (hdr -> taglen > NFS4_MAXTAGLEN );
10271026 encode_string (xdr , hdr -> taglen , hdr -> tag );
@@ -2341,9 +2340,9 @@ static void nfs4_xdr_enc_open(struct rpc_rqst *req, struct xdr_stream *xdr,
23412340 encode_getfattr_open (xdr , args -> bitmask , args -> open_bitmap , & hdr );
23422341 if (args -> lg_args ) {
23432342 encode_layoutget (xdr , args -> lg_args , & hdr );
2344- xdr_inline_pages ( & req -> rq_rcv_buf , hdr . replen << 2 ,
2345- args -> lg_args -> layout .pages ,
2346- 0 , args -> lg_args -> layout . pglen );
2343+ rpc_prepare_reply_pages ( req , args -> lg_args -> layout . pages , 0 ,
2344+ args -> lg_args -> layout .pglen ,
2345+ hdr . replen );
23472346 }
23482347 encode_nops (& hdr );
23492348}
@@ -2387,9 +2386,9 @@ static void nfs4_xdr_enc_open_noattr(struct rpc_rqst *req,
23872386 encode_getfattr_open (xdr , args -> bitmask , args -> open_bitmap , & hdr );
23882387 if (args -> lg_args ) {
23892388 encode_layoutget (xdr , args -> lg_args , & hdr );
2390- xdr_inline_pages ( & req -> rq_rcv_buf , hdr . replen << 2 ,
2391- args -> lg_args -> layout .pages ,
2392- 0 , args -> lg_args -> layout . pglen );
2389+ rpc_prepare_reply_pages ( req , args -> lg_args -> layout . pages , 0 ,
2390+ args -> lg_args -> layout .pglen ,
2391+ hdr . replen );
23932392 }
23942393 encode_nops (& hdr );
23952394}
@@ -2499,8 +2498,8 @@ static void nfs4_xdr_enc_readlink(struct rpc_rqst *req, struct xdr_stream *xdr,
24992498 encode_putfh (xdr , args -> fh , & hdr );
25002499 encode_readlink (xdr , args , req , & hdr );
25012500
2502- xdr_inline_pages ( & req -> rq_rcv_buf , hdr . replen << 2 , args -> pages ,
2503- args -> pgbase , args -> pglen );
2501+ rpc_prepare_reply_pages ( req , args -> pages , args -> pgbase ,
2502+ args -> pglen , hdr . replen );
25042503 encode_nops (& hdr );
25052504}
25062505
@@ -2520,11 +2519,8 @@ static void nfs4_xdr_enc_readdir(struct rpc_rqst *req, struct xdr_stream *xdr,
25202519 encode_putfh (xdr , args -> fh , & hdr );
25212520 encode_readdir (xdr , args , req , & hdr );
25222521
2523- xdr_inline_pages (& req -> rq_rcv_buf , hdr .replen << 2 , args -> pages ,
2524- args -> pgbase , args -> count );
2525- dprintk ("%s: inlined page args = (%u, %p, %u, %u)\n" ,
2526- __func__ , hdr .replen << 2 , args -> pages ,
2527- args -> pgbase , args -> count );
2522+ rpc_prepare_reply_pages (req , args -> pages , args -> pgbase ,
2523+ args -> count , hdr .replen );
25282524 encode_nops (& hdr );
25292525}
25302526
@@ -2544,8 +2540,8 @@ static void nfs4_xdr_enc_read(struct rpc_rqst *req, struct xdr_stream *xdr,
25442540 encode_putfh (xdr , args -> fh , & hdr );
25452541 encode_read (xdr , args , & hdr );
25462542
2547- xdr_inline_pages ( & req -> rq_rcv_buf , hdr . replen << 2 ,
2548- args -> pages , args -> pgbase , args -> count );
2543+ rpc_prepare_reply_pages ( req , args -> pages , args -> pgbase ,
2544+ args -> count , hdr . replen );
25492545 req -> rq_rcv_buf .flags |= XDRBUF_READ ;
25502546 encode_nops (& hdr );
25512547}
@@ -2591,9 +2587,8 @@ static void nfs4_xdr_enc_getacl(struct rpc_rqst *req, struct xdr_stream *xdr,
25912587 encode_getattr (xdr , nfs4_acl_bitmap , NULL ,
25922588 ARRAY_SIZE (nfs4_acl_bitmap ), & hdr );
25932589
2594- xdr_inline_pages (& req -> rq_rcv_buf , replen << 2 ,
2595- args -> acl_pages , 0 , args -> acl_len );
2596-
2590+ rpc_prepare_reply_pages (req , args -> acl_pages , 0 ,
2591+ args -> acl_len , replen );
25972592 encode_nops (& hdr );
25982593}
25992594
@@ -2814,9 +2809,8 @@ static void nfs4_xdr_enc_fs_locations(struct rpc_rqst *req,
28142809 encode_fs_locations (xdr , args -> bitmask , & hdr );
28152810 }
28162811
2817- /* Set up reply kvec to capture returned fs_locations array. */
2818- xdr_inline_pages (& req -> rq_rcv_buf , replen << 2 ,
2819- (struct page * * )& args -> page , 0 , PAGE_SIZE );
2812+ rpc_prepare_reply_pages (req , (struct page * * )& args -> page , 0 ,
2813+ PAGE_SIZE , replen );
28202814 encode_nops (& hdr );
28212815}
28222816
@@ -3018,10 +3012,8 @@ static void nfs4_xdr_enc_getdeviceinfo(struct rpc_rqst *req,
30183012
30193013 /* set up reply kvec. Subtract notification bitmap max size (2)
30203014 * so that notification bitmap is put in xdr_buf tail */
3021- xdr_inline_pages (& req -> rq_rcv_buf , (hdr .replen - 2 ) << 2 ,
3022- args -> pdev -> pages , args -> pdev -> pgbase ,
3023- args -> pdev -> pglen );
3024-
3015+ rpc_prepare_reply_pages (req , args -> pdev -> pages , args -> pdev -> pgbase ,
3016+ args -> pdev -> pglen , hdr .replen - 2 );
30253017 encode_nops (& hdr );
30263018}
30273019
@@ -3042,9 +3034,8 @@ static void nfs4_xdr_enc_layoutget(struct rpc_rqst *req,
30423034 encode_putfh (xdr , NFS_FH (args -> inode ), & hdr );
30433035 encode_layoutget (xdr , args , & hdr );
30443036
3045- xdr_inline_pages (& req -> rq_rcv_buf , hdr .replen << 2 ,
3046- args -> layout .pages , 0 , args -> layout .pglen );
3047-
3037+ rpc_prepare_reply_pages (req , args -> layout .pages , 0 ,
3038+ args -> layout .pglen , hdr .replen );
30483039 encode_nops (& hdr );
30493040}
30503041
0 commit comments