Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chuck Lever and committed by
J. Bruce Fields
26a41409 8c3916f4

+13 -20
+2 -2
fs/lockd/clntlock.c
··· 54 54 u32 nlm_version = (nlm_init->nfs_version == 2) ? 1 : 4; 55 55 int status; 56 56 57 - status = lockd_up(nlm_init->protocol); 57 + status = lockd_up(); 58 58 if (status < 0) 59 59 return ERR_PTR(status); 60 60 ··· 215 215 /* This one ensures that our parent doesn't terminate while the 216 216 * reclaim is in progress */ 217 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 220 dprintk("lockd: reclaiming locks for host %s\n", host->h_name); 221 221
+1 -2
fs/lockd/svc.c
··· 230 230 /* 231 231 * Bring up the lockd process if it's not already up. 232 232 */ 233 - int 234 - lockd_up(int proto) /* Maybe add a 'family' option when IPv6 is supported ?? */ 233 + int lockd_up(void) 235 234 { 236 235 struct svc_serv *serv; 237 236 int error = 0;
+2 -3
fs/nfsd/nfsctl.c
··· 614 614 return -EINVAL; 615 615 err = nfsd_create_serv(); 616 616 if (!err) { 617 - int proto = 0; 618 - err = svc_addsock(nfsd_serv, fd, buf, &proto); 617 + err = svc_addsock(nfsd_serv, fd, buf, NULL); 619 618 if (err >= 0) { 620 - err = lockd_up(proto); 619 + err = lockd_up(); 621 620 if (err < 0) 622 621 svc_sock_names(buf+strlen(buf)+1, nfsd_serv, buf); 623 622 }
+7 -12
fs/nfsd/nfssvc.c
··· 244 244 if (!list_empty(&nfsd_serv->sv_permsocks)) 245 245 return 0; 246 246 247 - error = lockd_up(IPPROTO_UDP); 248 - if (error >= 0) { 249 - error = svc_create_xprt(nfsd_serv, "udp", port, 247 + error = svc_create_xprt(nfsd_serv, "udp", port, 250 248 SVC_SOCK_DEFAULTS); 251 - if (error < 0) 252 - lockd_down(); 253 - } 254 249 if (error < 0) 255 250 return error; 256 251 257 - error = lockd_up(IPPROTO_TCP); 258 - if (error >= 0) { 259 - error = svc_create_xprt(nfsd_serv, "tcp", port, 252 + error = svc_create_xprt(nfsd_serv, "tcp", port, 260 253 SVC_SOCK_DEFAULTS); 261 - if (error < 0) 262 - lockd_down(); 263 - } 264 254 if (error < 0) 265 255 return error; 256 + 257 + error = lockd_up(); 258 + if (error < 0) 259 + return error; 260 + 266 261 return 0; 267 262 } 268 263
+1 -1
include/linux/lockd/bind.h
··· 52 52 53 53 extern int nlmclnt_proc(struct nlm_host *host, int cmd, 54 54 struct file_lock *fl); 55 - extern int lockd_up(int proto); 55 + extern int lockd_up(void); 56 56 extern void lockd_down(void); 57 57 58 58 #endif /* LINUX_LOCKD_BIND_H */