aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--fs/lockd/svc.c2
-rw-r--r--fs/nfs/callback.c3
-rw-r--r--fs/nfsd/nfssvc.c1
-rw-r--r--include/linux/sunrpc/svc.h9
-rw-r--r--net/sunrpc/svc.c11
5 files changed, 15 insertions, 11 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 5bd9bf0fa9df..1553fecc567d 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -266,7 +266,7 @@ lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */
266 "lockd_up: no pid, %d users??\n", nlmsvc_users); 266 "lockd_up: no pid, %d users??\n", nlmsvc_users);
267 267
268 error = -ENOMEM; 268 error = -ENOMEM;
269 serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, NULL); 269 serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, AF_INET, NULL);
270 if (!serv) { 270 if (!serv) {
271 printk(KERN_WARNING "lockd_up: create service failed\n"); 271 printk(KERN_WARNING "lockd_up: create service failed\n");
272 goto out; 272 goto out;
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index f447f4b4476c..6a09760c5960 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -105,7 +105,8 @@ int nfs_callback_up(void)
105 mutex_lock(&nfs_callback_mutex); 105 mutex_lock(&nfs_callback_mutex);
106 if (nfs_callback_info.users++ || nfs_callback_info.task != NULL) 106 if (nfs_callback_info.users++ || nfs_callback_info.task != NULL)
107 goto out; 107 goto out;
108 serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE, NULL); 108 serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE,
109 AF_INET, NULL);
109 ret = -ENOMEM; 110 ret = -ENOMEM;
110 if (!serv) 111 if (!serv)
111 goto out_err; 112 goto out_err;
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 80292ff5e924..7f3d76a7839d 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -229,6 +229,7 @@ int nfsd_create_serv(void)
229 229
230 atomic_set(&nfsd_busy, 0); 230 atomic_set(&nfsd_busy, 0);
231 nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize, 231 nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize,
232 AF_INET,
232 nfsd_last_thread, nfsd, THIS_MODULE); 233 nfsd_last_thread, nfsd, THIS_MODULE);
233 if (nfsd_serv == NULL) 234 if (nfsd_serv == NULL)
234 err = -ENOMEM; 235 err = -ENOMEM;
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index dc69068d94c7..23143f38b121 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -66,6 +66,7 @@ struct svc_serv {
66 struct list_head sv_tempsocks; /* all temporary sockets */ 66 struct list_head sv_tempsocks; /* all temporary sockets */
67 int sv_tmpcnt; /* count of temporary sockets */ 67 int sv_tmpcnt; /* count of temporary sockets */
68 struct timer_list sv_temptimer; /* timer for aging temporary sockets */ 68 struct timer_list sv_temptimer; /* timer for aging temporary sockets */
69 sa_family_t sv_family; /* listener's address family */
69 70
70 char * sv_name; /* service name */ 71 char * sv_name; /* service name */
71 72
@@ -381,14 +382,14 @@ struct svc_procedure {
381/* 382/*
382 * Function prototypes. 383 * Function prototypes.
383 */ 384 */
384struct svc_serv * svc_create(struct svc_program *, unsigned int, 385struct svc_serv *svc_create(struct svc_program *, unsigned int, sa_family_t,
385 void (*shutdown)(struct svc_serv*)); 386 void (*shutdown)(struct svc_serv *));
386struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, 387struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
387 struct svc_pool *pool); 388 struct svc_pool *pool);
388void svc_exit_thread(struct svc_rqst *); 389void svc_exit_thread(struct svc_rqst *);
389struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, 390struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
390 void (*shutdown)(struct svc_serv*), svc_thread_fn, 391 sa_family_t, void (*shutdown)(struct svc_serv *),
391 struct module *); 392 svc_thread_fn, struct module *);
392int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); 393int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
393void svc_destroy(struct svc_serv *); 394void svc_destroy(struct svc_serv *);
394int svc_process(struct svc_rqst *); 395int svc_process(struct svc_rqst *);
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;