public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: "J. Bruce Fields" <bfields@fieldses.org>,
	Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 17/20] SUNRPC: move the pool_map definitions (back) into svc.c
Date: Mon, 29 Nov 2021 15:51:25 +1100	[thread overview]
Message-ID: <163816148563.32298.112655599730856597.stgit@noble.brown> (raw)
In-Reply-To: <163816133466.32298.13831616524908720974.stgit@noble.brown>

These definitions are not used outside of svc.c, and there is no
evidence that they ever have been.  So move them into svc.c
and make the declarations 'static'.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 include/linux/sunrpc/svc.h |   25 -------------------------
 net/sunrpc/svc.c           |   31 +++++++++++++++++++++++++------
 2 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 0b38c6eaf985..d69e6108cb83 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -494,29 +494,6 @@ struct svc_procedure {
 	const char *		pc_name;	/* for display */
 };
 
-/*
- * Mode for mapping cpus to pools.
- */
-enum {
-	SVC_POOL_AUTO = -1,	/* choose one of the others */
-	SVC_POOL_GLOBAL,	/* no mapping, just a single global pool
-				 * (legacy & UP mode) */
-	SVC_POOL_PERCPU,	/* one pool per cpu */
-	SVC_POOL_PERNODE	/* one pool per numa node */
-};
-
-struct svc_pool_map {
-	int count;			/* How many svc_servs use us */
-	int mode;			/* Note: int not enum to avoid
-					 * warnings about "enumeration value
-					 * not handled in switch" */
-	unsigned int npools;
-	unsigned int *pool_to;		/* maps pool id to cpu or node */
-	unsigned int *to_pool;		/* maps cpu or node to pool id */
-};
-
-extern struct svc_pool_map svc_pool_map;
-
 /*
  * Function prototypes.
  */
@@ -533,8 +510,6 @@ void		   svc_rqst_replace_page(struct svc_rqst *rqstp,
 					 struct page *page);
 void		   svc_rqst_free(struct svc_rqst *);
 void		   svc_exit_thread(struct svc_rqst *);
-unsigned int	   svc_pool_map_get(void);
-void		   svc_pool_map_put(void);
 struct svc_serv *  svc_create_pooled(struct svc_program *, unsigned int,
 			const struct svc_serv_ops *);
 int		   svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 5513f8c9a8d6..f0dd9ef7e0cd 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -41,14 +41,35 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net);
 
 #define SVC_POOL_DEFAULT	SVC_POOL_GLOBAL
 
+/*
+ * Mode for mapping cpus to pools.
+ */
+enum {
+	SVC_POOL_AUTO = -1,	/* choose one of the others */
+	SVC_POOL_GLOBAL,	/* no mapping, just a single global pool
+				 * (legacy & UP mode) */
+	SVC_POOL_PERCPU,	/* one pool per cpu */
+	SVC_POOL_PERNODE	/* one pool per numa node */
+};
+
 /*
  * Structure for mapping cpus to pools and vice versa.
  * Setup once during sunrpc initialisation.
  */
-struct svc_pool_map svc_pool_map = {
+
+struct svc_pool_map {
+	int count;			/* How many svc_servs use us */
+	int mode;			/* Note: int not enum to avoid
+					 * warnings about "enumeration value
+					 * not handled in switch" */
+	unsigned int npools;
+	unsigned int *pool_to;		/* maps pool id to cpu or node */
+	unsigned int *to_pool;		/* maps cpu or node to pool id */
+};
+
+static struct svc_pool_map svc_pool_map = {
 	.mode = SVC_POOL_DEFAULT
 };
-EXPORT_SYMBOL_GPL(svc_pool_map);
 
 static DEFINE_MUTEX(svc_pool_map_mutex);/* protects svc_pool_map.count only */
 
@@ -222,7 +243,7 @@ svc_pool_map_init_pernode(struct svc_pool_map *m)
  * vice versa).  Initialise the map if we're the first user.
  * Returns the number of pools.
  */
-unsigned int
+static unsigned int
 svc_pool_map_get(void)
 {
 	struct svc_pool_map *m = &svc_pool_map;
@@ -257,7 +278,6 @@ svc_pool_map_get(void)
 	mutex_unlock(&svc_pool_map_mutex);
 	return m->npools;
 }
-EXPORT_SYMBOL_GPL(svc_pool_map_get);
 
 /*
  * Drop a reference to the global map of cpus to pools.
@@ -266,7 +286,7 @@ EXPORT_SYMBOL_GPL(svc_pool_map_get);
  * mode using the pool_mode module option without
  * rebooting or re-loading sunrpc.ko.
  */
-void
+static void
 svc_pool_map_put(void)
 {
 	struct svc_pool_map *m = &svc_pool_map;
@@ -283,7 +303,6 @@ svc_pool_map_put(void)
 
 	mutex_unlock(&svc_pool_map_mutex);
 }
-EXPORT_SYMBOL_GPL(svc_pool_map_put);
 
 static int svc_pool_map_get_node(unsigned int pidx)
 {



  parent reply	other threads:[~2021-11-29  4:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29  4:51 [PATCH 00/20 v3] SUNRPC: clean up server thread management NeilBrown
2021-11-29  4:51 ` [PATCH 12/20] lockd: simplify management of network status notifiers NeilBrown
2021-11-29  4:51 ` [PATCH 06/20] SUNRPC: use sv_lock to protect updates to sv_nrthreads NeilBrown
2021-11-29  4:51 ` [PATCH 01/20] NFSD: handle errors better in write_ports_addfd() NeilBrown
2021-11-29  4:51 ` NeilBrown [this message]
2021-11-29  4:51 ` [PATCH 19/20] lockd: use svc_set_num_threads() for thread start and stop NeilBrown
2021-11-29  4:51 ` [PATCH 10/20] NFSD: simplify locking for network notifier NeilBrown
2021-11-29  4:51 ` [PATCH 03/20] SUNRPC/NFSD: clean up get/put functions NeilBrown
2021-11-29  4:51 ` [PATCH 02/20] SUNRPC: change svc_get() to return the svc NeilBrown
2021-11-29  4:51 ` [PATCH 08/20] NFSD: Make it possible to use svc_set_num_threads_sync NeilBrown
2021-11-29  4:51 ` [PATCH 20/20] NFS: switch the callback service back to non-pooled NeilBrown
2021-11-29  4:51 ` [PATCH 13/20] lockd: move lockd_start_svc() call into lockd_create_svc() NeilBrown
2023-06-02 15:46   ` Ido Schimmel
2023-06-02 21:28     ` NeilBrown
2023-06-03  9:33       ` Ido Schimmel
2023-06-03 14:58         ` Chuck Lever III
2021-11-29  4:51 ` [PATCH 16/20] lockd: rename lockd_create_svc() to lockd_get() NeilBrown
2021-11-29  4:51 ` [PATCH 07/20] NFSD: narrow nfsd_mutex protection in nfsd thread NeilBrown
2021-11-29  4:51 ` [PATCH 09/20] SUNRPC: discard svo_setup and rename svc_set_num_threads_sync() NeilBrown
2021-11-29  4:51 ` [PATCH 18/20] SUNRPC: always treat sv_nrpools==1 as "not pooled" NeilBrown
2021-11-29  4:51 ` [PATCH 14/20] lockd: move svc_exit_thread() into the thread NeilBrown
2021-11-29  4:51 ` [PATCH 05/20] nfsd: make nfsd_stats.th_cnt atomic_t NeilBrown
2021-11-29  4:51 ` [PATCH 15/20] lockd: introduce lockd_put() NeilBrown
2021-11-29  4:51 ` [PATCH 11/20] lockd: introduce nlmsvc_serv NeilBrown
2021-11-29  4:51 ` [PATCH 04/20] SUNRPC: stop using ->sv_nrthreads as a refcount NeilBrown
2021-11-29 17:45 ` [PATCH 00/20 v3] SUNRPC: clean up server thread management Chuck Lever III

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=163816148563.32298.112655599730856597.stgit@noble.brown \
    --to=neilb@suse.de \
    --cc=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --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