NFSD: move lockd_up() before svc_addsock()
authorChuck Lever <chuck.lever@oracle.com>
Thu, 23 Apr 2009 23:32:18 +0000 (19:32 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 28 Apr 2009 17:54:28 +0000 (13:54 -0400)
commitea068bad27cefc71ab03230dbf01a8f8d98da5ba
treee36b3c23598de4233ffae06fa556504082bd20eb
parent0a5372d8a13c3f670bf7c9c4a68ab04c3664fa28
NFSD: move lockd_up() before svc_addsock()

Clean up.

A couple of years ago, a series of commits, finishing with commit
5680c446, swapped the order of the lockd_up() and svc_addsock() calls
in __write_ports().  At that time lockd_up() needed to know the
transport protocol of the passed-in socket to start a listener on the
same transport protocol.

These days, lockd_up() doesn't take a protocol argument; it always
starts both a UDP and TCP listener.  It's now more straightforward to
try the lockd_up() first, then do a lockd_down() if the svc_addsock()
fails.

Careful review of this code shows that the svc_sock_names() call is
used only to close the just-opened socket in case lockd_up() fails.
So it is no longer needed if lockd_up() is done first.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfsctl.c