Skip to content

Commit

Permalink
NSM: Add dprintk() calls in nsm_find and nsm_release
Browse files Browse the repository at this point in the history
Introduce some dprintk() calls in fs/lockd/mon.c that are enabled by
the NLMDBG_MONITOR flag.  These report when we find, create, and
release nsm_handles.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
Chuck Lever authored and J. Bruce Fields committed Jan 6, 2009
1 parent 67c6d10 commit 5cf1c4b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/lockd/mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,15 @@ struct nsm_handle *nsm_find(const struct sockaddr *sap, const size_t salen,
atomic_inc(&pos->sm_count);
kfree(nsm);
nsm = pos;
dprintk("lockd: found nsm_handle for %s (%s), cnt %d\n",
pos->sm_name, pos->sm_addrbuf,
atomic_read(&pos->sm_count));
goto found;
}
if (nsm) {
list_add(&nsm->sm_link, &nsm_handles);
dprintk("lockd: created nsm_handle for %s (%s)\n",
nsm->sm_name, nsm->sm_addrbuf);
goto found;
}
spin_unlock(&nsm_lock);
Expand Down Expand Up @@ -291,6 +296,8 @@ void nsm_release(struct nsm_handle *nsm)
if (atomic_dec_and_lock(&nsm->sm_count, &nsm_lock)) {
list_del(&nsm->sm_link);
spin_unlock(&nsm_lock);
dprintk("lockd: destroyed nsm_handle for %s (%s)\n",
nsm->sm_name, nsm->sm_addrbuf);
kfree(nsm);
}
}
Expand Down

0 comments on commit 5cf1c4b

Please sign in to comment.