aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs
diff options
context:
space:
mode:
authorJake Burkholder <jake@FreeBSD.org>2000-12-13 00:17:05 +0000
committerJake Burkholder <jake@FreeBSD.org>2000-12-13 00:17:05 +0000
commitc0c255709081ed31ff044179c49ca7e8c6abb162 (patch)
tree4dfd199ffaa97feec65c14b175f47ccddbeed914 /sys/miscfs
parent1b3335af6a91bd501eacc94ea03d0f3221559b9b (diff)
downloadsrc-c0c255709081ed31ff044179c49ca7e8c6abb162.tar.gz
src-c0c255709081ed31ff044179c49ca7e8c6abb162.zip
- Change the allproc_lock to use a macro, ALLPROC_LOCK(how), instead
of explicit calls to lockmgr. Also provides macros for the flags pased to specify shared, exclusive or release which map to the lockmgr flags. This is so that the use of lockmgr can be easily replaced with optimized reader-writer locks. - Add some locking that I missed the first time.
Notes
Notes: svn path=/head/; revision=69947
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/procfs/procfs_vnops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c
index e37f3c27bc56..05ad13a0ea7a 100644
--- a/sys/miscfs/procfs/procfs_vnops.c
+++ b/sys/miscfs/procfs/procfs_vnops.c
@@ -820,8 +820,10 @@ procfs_readdir(ap)
int doingzomb = 0;
#endif
int pcnt = 0;
- struct proc *p = allproc.lh_first;
+ struct proc *p;
+ ALLPROC_LOCK(AP_SHARED);
+ p = allproc.lh_first;
for (; p && uio->uio_resid >= delen; i++, pcnt++) {
bzero((char *) dp, delen);
dp->d_reclen = delen;
@@ -878,6 +880,7 @@ procfs_readdir(ap)
}
#endif
+ ALLPROC_LOCK(AP_RELEASE);
break;
}