diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-07-20 14:10:22 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-07-23 08:51:26 -0400 |
commit | ac77efbe2b4d2a1e571a4f1e5b6e47de72a7d737 (patch) | |
tree | 2ebb9f5178a3b81e357f95966f1e2eb0269e8e35 /fs/nfsd/nfsctl.c | |
parent | 628b368728e23188ac41b3f00411b02be8e697f1 (diff) |
nfsd: just keep single lockd reference for nfsd
Right now, nfsd keeps a lockd reference for each socket that it has
open. This is unnecessary and complicates the error handling on
startup and shutdown. Change it to just do a lockd_up when starting
the first nfsd thread just do a single lockd_down when taking down the
last nfsd thread. Because of the strange way the sv_count is handled
this requires an extra flag to tell whether the nfsd_serv holds a
reference for lockd or not.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 9e8645a07fca..b1c5be85bea5 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -949,15 +949,8 @@ static ssize_t __write_ports_addfd(char *buf) | |||
949 | if (err != 0) | 949 | if (err != 0) |
950 | return err; | 950 | return err; |
951 | 951 | ||
952 | err = lockd_up(); | ||
953 | if (err != 0) { | ||
954 | svc_destroy(nfsd_serv); | ||
955 | return err; | ||
956 | } | ||
957 | |||
958 | err = svc_addsock(nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT); | 952 | err = svc_addsock(nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT); |
959 | if (err < 0) { | 953 | if (err < 0) { |
960 | lockd_down(); | ||
961 | svc_destroy(nfsd_serv); | 954 | svc_destroy(nfsd_serv); |
962 | return err; | 955 | return err; |
963 | } | 956 | } |
@@ -982,9 +975,6 @@ static ssize_t __write_ports_delfd(char *buf) | |||
982 | if (nfsd_serv != NULL) | 975 | if (nfsd_serv != NULL) |
983 | len = svc_sock_names(nfsd_serv, buf, | 976 | len = svc_sock_names(nfsd_serv, buf, |
984 | SIMPLE_TRANSACTION_LIMIT, toclose); | 977 | SIMPLE_TRANSACTION_LIMIT, toclose); |
985 | if (len >= 0) | ||
986 | lockd_down(); | ||
987 | |||
988 | kfree(toclose); | 978 | kfree(toclose); |
989 | return len; | 979 | return len; |
990 | } | 980 | } |