Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@primarydata.com>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 03/10] sunrpc: move rq_local field to rq_flags
Date: Wed, 19 Nov 2014 07:51:15 -0500	[thread overview]
Message-ID: <1416401482-2562-4-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/vfs.c                 | 4 ++--
 include/linux/sunrpc/svc.h    | 2 +-
 include/trace/events/sunrpc.h | 3 ++-
 net/sunrpc/svcsock.c          | 5 ++++-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 989129e2d6ea..d4ab255ae4a8 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -940,7 +940,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
 	loff_t			pos = offset;
 	unsigned int		pflags = current->flags;
 
-	if (rqstp->rq_local)
+	if (test_bit(RQ_LOCAL, &rqstp->rq_flags))
 		/*
 		 * We want less throttling in balance_dirty_pages()
 		 * and shrink_inactive_list() so that nfs to
@@ -981,7 +981,7 @@ out_nfserr:
 		err = 0;
 	else
 		err = nfserrno(host_err);
-	if (rqstp->rq_local)
+	if (test_bit(RQ_LOCAL, &rqstp->rq_flags))
 		tsk_restore_flags(current, pflags, PF_LESS_THROTTLE);
 	return err;
 }
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index b60eb7c3f3f7..a91df9047f32 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -254,8 +254,8 @@ struct svc_rqst {
 	u32			rq_proc;	/* procedure number */
 	u32			rq_prot;	/* IP protocol */
 #define	RQ_SECURE	(0)			/* secure port */
+#define	RQ_LOCAL	(1)			/* local request */
 	unsigned long		rq_flags;	/* flags field */
-	unsigned short		rq_local   : 1;	/* local request */
 
 	void *			rq_argp;	/* decoded arguments */
 	void *			rq_resp;	/* xdr'd results */
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 5eb5f79d9794..98259f163cd8 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -414,7 +414,8 @@ TRACE_EVENT(xs_tcp_data_recv,
 
 #define show_rqstp_flags(flags)				\
 	__print_flags(flags, "|",			\
-		{ (1UL << RQ_SECURE),	"RQ_SECURE"})
+		{ (1UL << RQ_SECURE),	"RQ_SECURE"},	\
+		{ (1UL << RQ_LOCAL),	"RQ_LOCAL"})
 
 TRACE_EVENT(svc_recv,
 	TP_PROTO(struct svc_rqst *rqst, int status),
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 3f959c681885..74db5ca60b33 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1140,7 +1140,10 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
 
 	rqstp->rq_xprt_ctxt   = NULL;
 	rqstp->rq_prot	      = IPPROTO_TCP;
-	rqstp->rq_local	      = !!test_bit(XPT_LOCAL, &svsk->sk_xprt.xpt_flags);
+	if (test_bit(XPT_LOCAL, &svsk->sk_xprt.xpt_flags))
+		set_bit(RQ_LOCAL, &rqstp->rq_flags);
+	else
+		clear_bit(RQ_LOCAL, &rqstp->rq_flags);
 
 	p = (__be32 *)rqstp->rq_arg.head[0].iov_base;
 	calldir = p[1];
-- 
2.1.0


  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 ` Jeff Layton [this message]
2014-11-19 12:51 ` [PATCH 04/10] sunrpc: move rq_usedeferral flag to rq_flags Jeff Layton
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-4-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