diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-12-04 20:21:31 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-01-06 17:53:52 +0100 |
commit | c8c23c423dec49cb439697d3dc714e1500ff1610 (patch) | |
tree | 161035f51e31cce6d9f8dc104bad62a329496a77 /fs/lockd/mon.c | |
parent | NLM: Move the public declaration of nsm_monitor() to lockd.h (diff) | |
download | linux-c8c23c423dec49cb439697d3dc714e1500ff1610.tar.xz linux-c8c23c423dec49cb439697d3dc714e1500ff1610.zip |
NSM: Release nsmhandle in nlm_destroy_host
The nsm_handle's reference count is bumped in nlm_lookup_host(). It
should be decremented in nlm_destroy_host() to make it easier to see
the balance of these two operations.
Move the nsm_release() call to fs/lockd/host.c.
The h_nsmhandle pointer is set in nlm_lookup_host(), and never cleared.
The nlm_destroy_host() function is never called for the same nlm_host
twice, so h_nsmhandle won't ever be NULL when nsm_unmonitor() is
called.
All references to the nlm_host are gone before it is freed. We can
skip making h_nsmhandle NULL just before the nlm_host is deallocated.
It's also likely we can remove the h_nsmhandle NULL check in
nlmsvc_is_client() as well, but we can do that later when rearchitect-
ing the nlm_host cache.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/mon.c')
-rw-r--r-- | fs/lockd/mon.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index aaaa08e7ae7a..15fab22db028 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c @@ -117,10 +117,6 @@ nsm_unmonitor(struct nlm_host *host) struct nsm_res res; int status = 0; - if (nsm == NULL) - return 0; - host->h_nsmhandle = NULL; - if (atomic_read(&nsm->sm_count) == 1 && nsm->sm_monitored && !nsm->sm_sticky) { dprintk("lockd: nsm_unmonitor(%s)\n", nsm->sm_name); @@ -132,7 +128,6 @@ nsm_unmonitor(struct nlm_host *host) else nsm->sm_monitored = 0; } - nsm_release(nsm); return status; } |