|
@@ -36,34 +36,17 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net);
|
|
|
|
|
|
#define svc_serv_is_pooled(serv) ((serv)->sv_ops->svo_function)
|
|
|
|
|
|
-/*
|
|
|
- * 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 */
|
|
|
-};
|
|
|
#define SVC_POOL_DEFAULT SVC_POOL_GLOBAL
|
|
|
|
|
|
/*
|
|
|
* Structure for mapping cpus to pools and vice versa.
|
|
|
* Setup once during sunrpc initialisation.
|
|
|
*/
|
|
|
-static 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 */
|
|
|
-} svc_pool_map = {
|
|
|
- .count = 0,
|
|
|
+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 */
|
|
|
|
|
|
static int
|
|
@@ -236,7 +219,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.
|
|
|
*/
|
|
|
-static unsigned int
|
|
|
+unsigned int
|
|
|
svc_pool_map_get(void)
|
|
|
{
|
|
|
struct svc_pool_map *m = &svc_pool_map;
|
|
@@ -271,7 +254,7 @@ 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.
|
|
@@ -280,7 +263,7 @@ svc_pool_map_get(void)
|
|
|
* mode using the pool_mode module option without
|
|
|
* rebooting or re-loading sunrpc.ko.
|
|
|
*/
|
|
|
-static void
|
|
|
+void
|
|
|
svc_pool_map_put(void)
|
|
|
{
|
|
|
struct svc_pool_map *m = &svc_pool_map;
|
|
@@ -297,7 +280,7 @@ 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)
|
|
|
{
|