summaryrefslogtreecommitdiffstats
path: root/sys/netncp
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2000-10-04 01:29:17 +0000
committerjasone <jasone@FreeBSD.org>2000-10-04 01:29:17 +0000
commit4e290e67b7310d906f113850fddfdf1017a9d15b (patch)
treebae3e99c848c6e38aee34a7cf61ffa9ca55b0095 /sys/netncp
parentbea51a4aa1bf67a183bd1d4a6227fa891345af60 (diff)
downloadFreeBSD-src-4e290e67b7310d906f113850fddfdf1017a9d15b.zip
FreeBSD-src-4e290e67b7310d906f113850fddfdf1017a9d15b.tar.gz
Convert lockmgr locks from using simple locks to using mutexes.
Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed.
Diffstat (limited to 'sys/netncp')
-rw-r--r--sys/netncp/ncp_conn.c8
-rw-r--r--sys/netncp/ncp_conn.h1
-rw-r--r--sys/netncp/ncp_subr.c1
3 files changed, 10 insertions, 0 deletions
diff --git a/sys/netncp/ncp_conn.c b/sys/netncp/ncp_conn.c
index 3cfc449..df86f99 100644
--- a/sys/netncp/ncp_conn.c
+++ b/sys/netncp/ncp_conn.c
@@ -79,6 +79,13 @@ ncp_conn_init(void) {
}
int
+ncp_conn_destroy(void) {
+ lockdestroy(&listlock);
+ lockdestroy(&lhlock);
+ return 0;
+}
+
+int
ncp_conn_locklist(int flags, struct proc *p){
return lockmgr(&listlock, flags | LK_CANRECURSE, 0, p);
}
@@ -231,6 +238,7 @@ ncp_conn_free(struct ncp_conn *ncp) {
* if signal is raised - how I do react ?
*/
lockmgr(&ncp->nc_lock, LK_DRAIN, 0, ncp->procp);
+ lockdestroy(&ncp->nc_lock);
while (ncp->nc_lwant) {
printf("lwant = %d\n", ncp->nc_lwant);
tsleep(&ncp->nc_lwant, PZERO,"ncpdr",2*hz);
diff --git a/sys/netncp/ncp_conn.h b/sys/netncp/ncp_conn.h
index 850e5e7..0171421 100644
--- a/sys/netncp/ncp_conn.h
+++ b/sys/netncp/ncp_conn.h
@@ -204,6 +204,7 @@ struct ncp_conn {
#define ncp_conn_invalidate(conn) {conn->flags |= NCPFL_INVALID;}
int ncp_conn_init(void);
+int ncp_conn_destroy(void);
int ncp_conn_alloc(struct proc *p,struct ucred *cred, struct ncp_conn **connid);
int ncp_conn_free(struct ncp_conn *conn);
int ncp_conn_access(struct ncp_conn *conn,struct ucred *cred,mode_t mode);
diff --git a/sys/netncp/ncp_subr.c b/sys/netncp/ncp_subr.c
index a14e3f0..4601690 100644
--- a/sys/netncp/ncp_subr.c
+++ b/sys/netncp/ncp_subr.c
@@ -124,6 +124,7 @@ ncp_done(void) {
ncp_conn_unlock(ncp,p);
}
ncp_conn_unlocklist(p);
+ ncp_conn_destroy();
}
OpenPOWER on IntegriCloud