aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-11-19 07:51:16 -0500
committerJ. Bruce Fields <bfields@redhat.com>2014-12-09 11:22:20 -0500
commit30660e04b0d4bbbd15fd21098681f45a9f4080b9 (patch)
treee331b3dab619532ee1cf37c1354e9f7246398f1a
parent7501cc2bcf9a71cc1f19e38775c234815ee44578 (diff)
sunrpc: move rq_usedeferral flag to rq_flags
Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4proc.c4
-rw-r--r--include/linux/sunrpc/svc.h2
-rw-r--r--include/trace/events/sunrpc.h9
-rw-r--r--net/sunrpc/svc.c2
-rw-r--r--net/sunrpc/svc_xprt.c2
5 files changed, 10 insertions, 9 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 74fb15eefc31..6f98393ad0d9 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1370,7 +1370,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
1370 * Don't use the deferral mechanism for NFSv4; compounds make it 1370 * Don't use the deferral mechanism for NFSv4; compounds make it
1371 * too hard to avoid non-idempotency problems. 1371 * too hard to avoid non-idempotency problems.
1372 */ 1372 */
1373 rqstp->rq_usedeferral = false; 1373 clear_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
1374 1374
1375 /* 1375 /*
1376 * According to RFC3010, this takes precedence over all other errors. 1376 * According to RFC3010, this takes precedence over all other errors.
@@ -1486,7 +1486,7 @@ encode_op:
1486 BUG_ON(cstate->replay_owner); 1486 BUG_ON(cstate->replay_owner);
1487out: 1487out:
1488 /* Reset deferral mechanism for RPC deferrals */ 1488 /* Reset deferral mechanism for RPC deferrals */
1489 rqstp->rq_usedeferral = true; 1489 set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
1490 dprintk("nfsv4 compound returned %d\n", ntohl(status)); 1490 dprintk("nfsv4 compound returned %d\n", ntohl(status));
1491 return status; 1491 return status;
1492} 1492}
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index a91df9047f32..6a3cf4c76dce 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -236,7 +236,6 @@ struct svc_rqst {
236 struct svc_cred rq_cred; /* auth info */ 236 struct svc_cred rq_cred; /* auth info */
237 void * rq_xprt_ctxt; /* transport specific context ptr */ 237 void * rq_xprt_ctxt; /* transport specific context ptr */
238 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ 238 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */
239 bool rq_usedeferral; /* use deferral */
240 239
241 size_t rq_xprt_hlen; /* xprt header len */ 240 size_t rq_xprt_hlen; /* xprt header len */
242 struct xdr_buf rq_arg; 241 struct xdr_buf rq_arg;
@@ -255,6 +254,7 @@ struct svc_rqst {
255 u32 rq_prot; /* IP protocol */ 254 u32 rq_prot; /* IP protocol */
256#define RQ_SECURE (0) /* secure port */ 255#define RQ_SECURE (0) /* secure port */
257#define RQ_LOCAL (1) /* local request */ 256#define RQ_LOCAL (1) /* local request */
257#define RQ_USEDEFERRAL (2) /* use deferral */
258 unsigned long rq_flags; /* flags field */ 258 unsigned long rq_flags; /* flags field */
259 259
260 void * rq_argp; /* decoded arguments */ 260 void * rq_argp; /* decoded arguments */
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 98259f163cd8..6d1facdebc92 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -412,10 +412,11 @@ TRACE_EVENT(xs_tcp_data_recv,
412 __entry->copied, __entry->reclen, __entry->offset) 412 __entry->copied, __entry->reclen, __entry->offset)
413); 413);
414 414
415#define show_rqstp_flags(flags) \ 415#define show_rqstp_flags(flags) \
416 __print_flags(flags, "|", \ 416 __print_flags(flags, "|", \
417 { (1UL << RQ_SECURE), "RQ_SECURE"}, \ 417 { (1UL << RQ_SECURE), "RQ_SECURE"}, \
418 { (1UL << RQ_LOCAL), "RQ_LOCAL"}) 418 { (1UL << RQ_LOCAL), "RQ_LOCAL"}, \
419 { (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"})
419 420
420TRACE_EVENT(svc_recv, 421TRACE_EVENT(svc_recv,
421 TP_PROTO(struct svc_rqst *rqst, int status), 422 TP_PROTO(struct svc_rqst *rqst, int status),
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 163df468d6d5..f6a8f2f7a253 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1090,7 +1090,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1090 /* Will be turned off only in gss privacy case: */ 1090 /* Will be turned off only in gss privacy case: */
1091 rqstp->rq_splice_ok = true; 1091 rqstp->rq_splice_ok = true;
1092 /* Will be turned off only when NFSv4 Sessions are used */ 1092 /* Will be turned off only when NFSv4 Sessions are used */
1093 rqstp->rq_usedeferral = true; 1093 set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
1094 rqstp->rq_dropme = false; 1094 rqstp->rq_dropme = false;
1095 1095
1096 /* Setup reply header */ 1096 /* Setup reply header */
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index eaa9263c2d28..a40f3755a33d 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -1081,7 +1081,7 @@ static struct cache_deferred_req *svc_defer(struct cache_req *req)
1081 struct svc_rqst *rqstp = container_of(req, struct svc_rqst, rq_chandle); 1081 struct svc_rqst *rqstp = container_of(req, struct svc_rqst, rq_chandle);
1082 struct svc_deferred_req *dr; 1082 struct svc_deferred_req *dr;
1083 1083
1084 if (rqstp->rq_arg.page_len || !rqstp->rq_usedeferral) 1084 if (rqstp->rq_arg.page_len || !test_bit(RQ_USEDEFERRAL, &rqstp->rq_flags))
1085 return NULL; /* if more than a page, give up FIXME */ 1085 return NULL; /* if more than a page, give up FIXME */
1086 if (rqstp->rq_deferred) { 1086 if (rqstp->rq_deferred) {
1087 dr = rqstp->rq_deferred; 1087 dr = rqstp->rq_deferred;