diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2008-10-03 17:15:30 -0400 |
|---|---|---|
| committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-10-04 17:12:27 -0400 |
| commit | 26a414092353590ceaa5955bcb53f863d6ea7549 (patch) | |
| tree | d829a751e7f6dee7323039e6ea2340e78e5f9fd6 | |
| parent | 8c3916f4bdf9c8388bd70d0b399b3a43daf2087a (diff) | |
NLM: Remove "proto" argument from lockd_up()
Clean up: Now that lockd_up() starts listeners for both transports, the
"proto" argument is no longer needed.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
| -rw-r--r-- | fs/lockd/clntlock.c | 4 | ||||
| -rw-r--r-- | fs/lockd/svc.c | 3 | ||||
| -rw-r--r-- | fs/nfsd/nfsctl.c | 5 | ||||
| -rw-r--r-- | fs/nfsd/nfssvc.c | 19 | ||||
| -rw-r--r-- | include/linux/lockd/bind.h | 2 |
5 files changed, 13 insertions, 20 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index 2976bf0f4147..8307dd64bf46 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c | |||
| @@ -54,7 +54,7 @@ struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init) | |||
| 54 | u32 nlm_version = (nlm_init->nfs_version == 2) ? 1 : 4; | 54 | u32 nlm_version = (nlm_init->nfs_version == 2) ? 1 : 4; |
| 55 | int status; | 55 | int status; |
| 56 | 56 | ||
| 57 | status = lockd_up(nlm_init->protocol); | 57 | status = lockd_up(); |
| 58 | if (status < 0) | 58 | if (status < 0) |
| 59 | return ERR_PTR(status); | 59 | return ERR_PTR(status); |
| 60 | 60 | ||
| @@ -215,7 +215,7 @@ reclaimer(void *ptr) | |||
| 215 | /* This one ensures that our parent doesn't terminate while the | 215 | /* This one ensures that our parent doesn't terminate while the |
| 216 | * reclaim is in progress */ | 216 | * reclaim is in progress */ |
| 217 | lock_kernel(); | 217 | lock_kernel(); |
| 218 | lockd_up(0); /* note: this cannot fail as lockd is already running */ | 218 | lockd_up(); /* note: this cannot fail as lockd is already running */ |
| 219 | 219 | ||
| 220 | dprintk("lockd: reclaiming locks for host %s\n", host->h_name); | 220 | dprintk("lockd: reclaiming locks for host %s\n", host->h_name); |
| 221 | 221 | ||
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 36396fc058c5..c631a83931ce 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
| @@ -230,8 +230,7 @@ static int make_socks(struct svc_serv *serv) | |||
| 230 | /* | 230 | /* |
| 231 | * Bring up the lockd process if it's not already up. | 231 | * Bring up the lockd process if it's not already up. |
| 232 | */ | 232 | */ |
| 233 | int | 233 | int lockd_up(void) |
| 234 | lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */ | ||
| 235 | { | 234 | { |
| 236 | struct svc_serv *serv; | 235 | struct svc_serv *serv; |
| 237 | int error = 0; | 236 | int error = 0; |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index c53e65f8f3a2..862dff5247f7 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
| @@ -614,10 +614,9 @@ static ssize_t __write_ports(struct file *file, char *buf, size_t size) | |||
| 614 | return -EINVAL; | 614 | return -EINVAL; |
| 615 | err = nfsd_create_serv(); | 615 | err = nfsd_create_serv(); |
| 616 | if (!err) { | 616 | if (!err) { |
| 617 | int proto = 0; | 617 | err = svc_addsock(nfsd_serv, fd, buf, NULL); |
| 618 | err = svc_addsock(nfsd_serv, fd, buf, &proto); | ||
| 619 | if (err >= 0) { | 618 | if (err >= 0) { |
| 620 | err = lockd_up(proto); | 619 | err = lockd_up(); |
| 621 | if (err < 0) | 620 | if (err < 0) |
| 622 | svc_sock_names(buf+strlen(buf)+1, nfsd_serv, buf); | 621 | svc_sock_names(buf+strlen(buf)+1, nfsd_serv, buf); |
| 623 | } | 622 | } |
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 7f3d76a7839d..59eeb46f82c5 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c | |||
| @@ -244,25 +244,20 @@ static int nfsd_init_socks(int port) | |||
| 244 | if (!list_empty(&nfsd_serv->sv_permsocks)) | 244 | if (!list_empty(&nfsd_serv->sv_permsocks)) |
| 245 | return 0; | 245 | return 0; |
| 246 | 246 | ||
| 247 | error = lockd_up(IPPROTO_UDP); | 247 | error = svc_create_xprt(nfsd_serv, "udp", port, |
| 248 | if (error >= 0) { | ||
| 249 | error = svc_create_xprt(nfsd_serv, "udp", port, | ||
| 250 | SVC_SOCK_DEFAULTS); | 248 | SVC_SOCK_DEFAULTS); |
| 251 | if (error < 0) | ||
| 252 | lockd_down(); | ||
| 253 | } | ||
| 254 | if (error < 0) | 249 | if (error < 0) |
| 255 | return error; | 250 | return error; |
| 256 | 251 | ||
| 257 | error = lockd_up(IPPROTO_TCP); | 252 | error = svc_create_xprt(nfsd_serv, "tcp", port, |
| 258 | if (error >= 0) { | ||
| 259 | error = svc_create_xprt(nfsd_serv, "tcp", port, | ||
| 260 | SVC_SOCK_DEFAULTS); | 253 | SVC_SOCK_DEFAULTS); |
| 261 | if (error < 0) | ||
| 262 | lockd_down(); | ||
| 263 | } | ||
| 264 | if (error < 0) | 254 | if (error < 0) |
| 265 | return error; | 255 | return error; |
| 256 | |||
| 257 | error = lockd_up(); | ||
| 258 | if (error < 0) | ||
| 259 | return error; | ||
| 260 | |||
| 266 | return 0; | 261 | return 0; |
| 267 | } | 262 | } |
| 268 | 263 | ||
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index 1f0465c374dc..e5872dc994c0 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
| @@ -52,7 +52,7 @@ extern void nlmclnt_done(struct nlm_host *host); | |||
| 52 | 52 | ||
| 53 | extern int nlmclnt_proc(struct nlm_host *host, int cmd, | 53 | extern int nlmclnt_proc(struct nlm_host *host, int cmd, |
| 54 | struct file_lock *fl); | 54 | struct file_lock *fl); |
| 55 | extern int lockd_up(int proto); | 55 | extern int lockd_up(void); |
| 56 | extern void lockd_down(void); | 56 | extern void lockd_down(void); |
| 57 | 57 | ||
| 58 | #endif /* LINUX_LOCKD_BIND_H */ | 58 | #endif /* LINUX_LOCKD_BIND_H */ |
