summaryrefslogtreecommitdiff
path: root/sys/msdosfs
diff options
context:
space:
mode:
authorMartin Natano <natano@cvs.openbsd.org>2016-06-19 11:54:35 +0000
committerMartin Natano <natano@cvs.openbsd.org>2016-06-19 11:54:35 +0000
commitb70123aec90044d17f9882033c3f3ac7a1fb78f6 (patch)
tree84f74dc221b666238a94c4435ab5d31c75d67428 /sys/msdosfs
parentdf2ea89c9faeef8fb93ba702e7841560708f8a61 (diff)
Remove the lockmgr() API. It is only used by filesystems, where it is a
trivial change to use rrw locks instead. All it needs is LK_* defines for the RW_* flags. tested by naddy and sthen on package building infrastructure input and ok jmc mpi tedu
Diffstat (limited to 'sys/msdosfs')
-rw-r--r--sys/msdosfs/denode.h4
-rw-r--r--sys/msdosfs/msdosfs_denode.c4
-rw-r--r--sys/msdosfs/msdosfs_vnops.c9
3 files changed, 9 insertions, 8 deletions
diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h
index 0844e7e8c60..e9a142f8834 100644
--- a/sys/msdosfs/denode.h
+++ b/sys/msdosfs/denode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: denode.h,v 1.28 2016/01/13 10:00:55 mpi Exp $ */
+/* $OpenBSD: denode.h,v 1.29 2016/06/19 11:54:33 natano Exp $ */
/* $NetBSD: denode.h,v 1.24 1997/10/17 11:23:39 ws Exp $ */
/*-
@@ -149,7 +149,7 @@ struct denode {
long de_refcnt; /* reference count */
struct msdosfsmount *de_pmp; /* addr of our mount struct */
struct lockf *de_lockf; /* byte level lock list */
- struct lock de_lock; /* denode lock */
+ struct rrwlock de_lock; /* denode lock */
u_char de_Name[11]; /* name, from DOS directory entry */
u_char de_Attributes; /* attributes, from directory entry */
u_char de_CTimeHundredth; /* creation time, 1/100th of a sec */
diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c
index 1009a8a6795..b3515e6ee54 100644
--- a/sys/msdosfs/msdosfs_denode.c
+++ b/sys/msdosfs/msdosfs_denode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_denode.c,v 1.56 2016/03/19 12:04:16 natano Exp $ */
+/* $OpenBSD: msdosfs_denode.c,v 1.57 2016/06/19 11:54:33 natano Exp $ */
/* $NetBSD: msdosfs_denode.c,v 1.23 1997/10/17 11:23:58 ws Exp $ */
/*-
@@ -233,7 +233,7 @@ retry:
return (error);
}
ldep = malloc(sizeof(*ldep), M_MSDOSFSNODE, M_WAITOK | M_ZERO);
- lockinit(&ldep->de_lock, PINOD, "denode", 0, 0);
+ rrw_init(&ldep->de_lock, "denode");
nvp->v_data = ldep;
ldep->de_vnode = nvp;
ldep->de_flag = 0;
diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c
index b681887a31f..45a479fb646 100644
--- a/sys/msdosfs/msdosfs_vnops.c
+++ b/sys/msdosfs/msdosfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vnops.c,v 1.111 2016/05/21 18:11:36 natano Exp $ */
+/* $OpenBSD: msdosfs_vnops.c,v 1.112 2016/06/19 11:54:33 natano Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */
/*-
@@ -1721,7 +1721,7 @@ msdosfs_lock(void *v)
struct vop_lock_args *ap = v;
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags, NULL));
+ return rrw_enter(&VTODE(vp)->de_lock, ap->a_flags & LK_RWFLAGS);
}
int
@@ -1730,7 +1730,8 @@ msdosfs_unlock(void *v)
struct vop_unlock_args *ap = v;
struct vnode *vp = ap->a_vp;
- return (lockmgr(&VTODE(vp)->de_lock, LK_RELEASE, NULL));
+ rrw_exit(&VTODE(vp)->de_lock);
+ return 0;
}
int
@@ -1738,7 +1739,7 @@ msdosfs_islocked(void *v)
{
struct vop_islocked_args *ap = v;
- return (lockstatus(&VTODE(ap->a_vp)->de_lock));
+ return rrw_status(&VTODE(ap->a_vp)->de_lock);
}
/*