Skip to content

Commit cf0e124

Browse files
neilbrownchucklever
authored andcommitted
SUNRPC: move the pool_map definitions (back) into svc.c
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> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent ecd3ad6 commit cf0e124

2 files changed

Lines changed: 25 additions & 31 deletions

File tree

include/linux/sunrpc/svc.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -494,29 +494,6 @@ struct svc_procedure {
494494
const char * pc_name; /* for display */
495495
};
496496

497-
/*
498-
* Mode for mapping cpus to pools.
499-
*/
500-
enum {
501-
SVC_POOL_AUTO = -1, /* choose one of the others */
502-
SVC_POOL_GLOBAL, /* no mapping, just a single global pool
503-
* (legacy & UP mode) */
504-
SVC_POOL_PERCPU, /* one pool per cpu */
505-
SVC_POOL_PERNODE /* one pool per numa node */
506-
};
507-
508-
struct svc_pool_map {
509-
int count; /* How many svc_servs use us */
510-
int mode; /* Note: int not enum to avoid
511-
* warnings about "enumeration value
512-
* not handled in switch" */
513-
unsigned int npools;
514-
unsigned int *pool_to; /* maps pool id to cpu or node */
515-
unsigned int *to_pool; /* maps cpu or node to pool id */
516-
};
517-
518-
extern struct svc_pool_map svc_pool_map;
519-
520497
/*
521498
* Function prototypes.
522499
*/
@@ -533,8 +510,6 @@ void svc_rqst_replace_page(struct svc_rqst *rqstp,
533510
struct page *page);
534511
void svc_rqst_free(struct svc_rqst *);
535512
void svc_exit_thread(struct svc_rqst *);
536-
unsigned int svc_pool_map_get(void);
537-
void svc_pool_map_put(void);
538513
struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
539514
const struct svc_serv_ops *);
540515
int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);

net/sunrpc/svc.c

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,35 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net);
4141

4242
#define SVC_POOL_DEFAULT SVC_POOL_GLOBAL
4343

44+
/*
45+
* Mode for mapping cpus to pools.
46+
*/
47+
enum {
48+
SVC_POOL_AUTO = -1, /* choose one of the others */
49+
SVC_POOL_GLOBAL, /* no mapping, just a single global pool
50+
* (legacy & UP mode) */
51+
SVC_POOL_PERCPU, /* one pool per cpu */
52+
SVC_POOL_PERNODE /* one pool per numa node */
53+
};
54+
4455
/*
4556
* Structure for mapping cpus to pools and vice versa.
4657
* Setup once during sunrpc initialisation.
4758
*/
48-
struct svc_pool_map svc_pool_map = {
59+
60+
struct svc_pool_map {
61+
int count; /* How many svc_servs use us */
62+
int mode; /* Note: int not enum to avoid
63+
* warnings about "enumeration value
64+
* not handled in switch" */
65+
unsigned int npools;
66+
unsigned int *pool_to; /* maps pool id to cpu or node */
67+
unsigned int *to_pool; /* maps cpu or node to pool id */
68+
};
69+
70+
static struct svc_pool_map svc_pool_map = {
4971
.mode = SVC_POOL_DEFAULT
5072
};
51-
EXPORT_SYMBOL_GPL(svc_pool_map);
5273

5374
static DEFINE_MUTEX(svc_pool_map_mutex);/* protects svc_pool_map.count only */
5475

@@ -222,7 +243,7 @@ svc_pool_map_init_pernode(struct svc_pool_map *m)
222243
* vice versa). Initialise the map if we're the first user.
223244
* Returns the number of pools.
224245
*/
225-
unsigned int
246+
static unsigned int
226247
svc_pool_map_get(void)
227248
{
228249
struct svc_pool_map *m = &svc_pool_map;
@@ -257,7 +278,6 @@ svc_pool_map_get(void)
257278
mutex_unlock(&svc_pool_map_mutex);
258279
return m->npools;
259280
}
260-
EXPORT_SYMBOL_GPL(svc_pool_map_get);
261281

262282
/*
263283
* Drop a reference to the global map of cpus to pools.
@@ -266,7 +286,7 @@ EXPORT_SYMBOL_GPL(svc_pool_map_get);
266286
* mode using the pool_mode module option without
267287
* rebooting or re-loading sunrpc.ko.
268288
*/
269-
void
289+
static void
270290
svc_pool_map_put(void)
271291
{
272292
struct svc_pool_map *m = &svc_pool_map;
@@ -283,7 +303,6 @@ svc_pool_map_put(void)
283303

284304
mutex_unlock(&svc_pool_map_mutex);
285305
}
286-
EXPORT_SYMBOL_GPL(svc_pool_map_put);
287306

288307
static int svc_pool_map_get_node(unsigned int pidx)
289308
{

0 commit comments

Comments
 (0)