From: Jeff Layton <jlayton@primarydata.com>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 04/10] sunrpc: move rq_usedeferral flag to rq_flags
Date: Wed, 19 Nov 2014 07:51:16 -0500 [thread overview]
Message-ID: <1416401482-2562-5-git-send-email-jlayton@primarydata.com> (raw)
In-Reply-To: <1416401482-2562-1-git-send-email-jlayton@primarydata.com>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
fs/nfsd/nfs4proc.c | 4 ++--
include/linux/sunrpc/svc.h | 2 +-
include/trace/events/sunrpc.h | 9 +++++----
net/sunrpc/svc.c | 2 +-
net/sunrpc/svc_xprt.c | 2 +-
5 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 0beb023f25ac..7b897290a0a3 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1331,7 +1331,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
* Don't use the deferral mechanism for NFSv4; compounds make it
* too hard to avoid non-idempotency problems.
*/
- rqstp->rq_usedeferral = false;
+ clear_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
/*
* According to RFC3010, this takes precedence over all other errors.
@@ -1447,7 +1447,7 @@ encode_op:
BUG_ON(cstate->replay_owner);
out:
/* Reset deferral mechanism for RPC deferrals */
- rqstp->rq_usedeferral = true;
+ set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
dprintk("nfsv4 compound returned %d\n", ntohl(status));
return status;
}
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 {
struct svc_cred rq_cred; /* auth info */
void * rq_xprt_ctxt; /* transport specific context ptr */
struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */
- bool rq_usedeferral; /* use deferral */
size_t rq_xprt_hlen; /* xprt header len */
struct xdr_buf rq_arg;
@@ -255,6 +254,7 @@ struct svc_rqst {
u32 rq_prot; /* IP protocol */
#define RQ_SECURE (0) /* secure port */
#define RQ_LOCAL (1) /* local request */
+#define RQ_USEDEFERRAL (2) /* use deferral */
unsigned long rq_flags; /* flags field */
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,
__entry->copied, __entry->reclen, __entry->offset)
);
-#define show_rqstp_flags(flags) \
- __print_flags(flags, "|", \
- { (1UL << RQ_SECURE), "RQ_SECURE"}, \
- { (1UL << RQ_LOCAL), "RQ_LOCAL"})
+#define show_rqstp_flags(flags) \
+ __print_flags(flags, "|", \
+ { (1UL << RQ_SECURE), "RQ_SECURE"}, \
+ { (1UL << RQ_LOCAL), "RQ_LOCAL"}, \
+ { (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"})
TRACE_EVENT(svc_recv,
TP_PROTO(struct svc_rqst *rqst, int status),
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index d38b75b0e236..078c6447fa4f 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)
/* Will be turned off only in gss privacy case: */
rqstp->rq_splice_ok = true;
/* Will be turned off only when NFSv4 Sessions are used */
- rqstp->rq_usedeferral = true;
+ set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
rqstp->rq_dropme = false;
/* 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)
struct svc_rqst *rqstp = container_of(req, struct svc_rqst, rq_chandle);
struct svc_deferred_req *dr;
- if (rqstp->rq_arg.page_len || !rqstp->rq_usedeferral)
+ if (rqstp->rq_arg.page_len || !test_bit(RQ_USEDEFERRAL, &rqstp->rq_flags))
return NULL; /* if more than a page, give up FIXME */
if (rqstp->rq_deferred) {
dr = rqstp->rq_deferred;
--
2.1.0
next prev parent reply other threads:[~2014-11-19 12:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 12:51 [PATCH 00/10] sunrpc: fixes and cleanups for svc creation and thread handling Jeff Layton
2014-11-19 12:51 ` [PATCH 01/10] sunrpc: release svc_pool_map reference when serv allocation fails Jeff Layton
2014-11-19 12:51 ` [PATCH 02/10] sunrpc: add a generic rq_flags field to svc_rqst and move rq_secure to it Jeff Layton
2014-11-19 12:51 ` [PATCH 03/10] sunrpc: move rq_local field to rq_flags Jeff Layton
2014-11-19 12:51 ` Jeff Layton [this message]
2014-11-19 12:51 ` [PATCH 05/10] sunrpc: move rq_dropme flag into rq_flags Jeff Layton
2014-11-19 12:51 ` [PATCH 06/10] sunrpc: move rq_splice_ok " Jeff Layton
2014-11-19 12:51 ` [PATCH 07/10] sunrpc: move rq_cachetype field to better optimize space Jeff Layton
2014-11-19 12:51 ` [PATCH 08/10] sunrpc: convert sp_task_pending flag to use atomic bitops Jeff Layton
2014-11-19 12:51 ` [PATCH 09/10] sunrpc: have svc_wake_up only deal with pool 0 Jeff Layton
2014-11-19 12:51 ` [PATCH 10/10] sunrpc: require svc_create callers to pass in meaningful shutdown routine Jeff Layton
2014-11-19 14:57 ` [PATCH 00/10] sunrpc: fixes and cleanups for svc creation and thread handling J. Bruce Fields
2014-11-19 21:37 ` J. Bruce Fields
2014-11-19 21:59 ` Jeff Layton
2014-11-20 14:17 ` Anna Schumaker
2014-12-01 19:56 ` J. Bruce Fields
2014-12-01 20:08 ` Trond Myklebust
2014-12-01 20:12 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416401482-2562-5-git-send-email-jlayton@primarydata.com \
--to=jlayton@primarydata.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox