aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2008-06-30 18:45:30 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-09-29 17:56:56 -0400
commite851db5b05408b89b9a9429a66814b79fabee2a1 (patch)
tree99bac979ed90efed99c89a49cb77719ab4c0a229 /net/sunrpc/svc.c
parent72d31053f62c4bc464c2783974926969614a8649 (diff)
SUNRPC: Add address family field to svc_serv data structure
Introduce and initialize an address family field in the svc_serv structure. This field will determine what family to use for the service's listener sockets and what families are advertised via the local rpcbind daemon. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r--net/sunrpc/svc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 5a32cb7c4bb4..9ba17044109d 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -357,7 +357,7 @@ svc_pool_for_cpu(struct svc_serv *serv, int cpu)
357 */ 357 */
358static struct svc_serv * 358static struct svc_serv *
359__svc_create(struct svc_program *prog, unsigned int bufsize, int npools, 359__svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
360 void (*shutdown)(struct svc_serv *serv)) 360 sa_family_t family, void (*shutdown)(struct svc_serv *serv))
361{ 361{
362 struct svc_serv *serv; 362 struct svc_serv *serv;
363 unsigned int vers; 363 unsigned int vers;
@@ -366,6 +366,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
366 366
367 if (!(serv = kzalloc(sizeof(*serv), GFP_KERNEL))) 367 if (!(serv = kzalloc(sizeof(*serv), GFP_KERNEL)))
368 return NULL; 368 return NULL;
369 serv->sv_family = family;
369 serv->sv_name = prog->pg_name; 370 serv->sv_name = prog->pg_name;
370 serv->sv_program = prog; 371 serv->sv_program = prog;
371 serv->sv_nrthreads = 1; 372 serv->sv_nrthreads = 1;
@@ -425,21 +426,21 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
425 426
426struct svc_serv * 427struct svc_serv *
427svc_create(struct svc_program *prog, unsigned int bufsize, 428svc_create(struct svc_program *prog, unsigned int bufsize,
428 void (*shutdown)(struct svc_serv *serv)) 429 sa_family_t family, void (*shutdown)(struct svc_serv *serv))
429{ 430{
430 return __svc_create(prog, bufsize, /*npools*/1, shutdown); 431 return __svc_create(prog, bufsize, /*npools*/1, family, shutdown);
431} 432}
432EXPORT_SYMBOL(svc_create); 433EXPORT_SYMBOL(svc_create);
433 434
434struct svc_serv * 435struct svc_serv *
435svc_create_pooled(struct svc_program *prog, unsigned int bufsize, 436svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
436 void (*shutdown)(struct svc_serv *serv), 437 sa_family_t family, void (*shutdown)(struct svc_serv *serv),
437 svc_thread_fn func, struct module *mod) 438 svc_thread_fn func, struct module *mod)
438{ 439{
439 struct svc_serv *serv; 440 struct svc_serv *serv;
440 unsigned int npools = svc_pool_map_get(); 441 unsigned int npools = svc_pool_map_get();
441 442
442 serv = __svc_create(prog, bufsize, npools, shutdown); 443 serv = __svc_create(prog, bufsize, npools, family, shutdown);
443 444
444 if (serv != NULL) { 445 if (serv != NULL) {
445 serv->sv_function = func; 446 serv->sv_function = func;