diff options
author | Jake Burkholder <jake@FreeBSD.org> | 2000-12-13 00:17:05 +0000 |
---|---|---|
committer | Jake Burkholder <jake@FreeBSD.org> | 2000-12-13 00:17:05 +0000 |
commit | c0c255709081ed31ff044179c49ca7e8c6abb162 (patch) | |
tree | 4dfd199ffaa97feec65c14b175f47ccddbeed914 /sys/miscfs/procfs/procfs_vnops.c | |
parent | 1b3335af6a91bd501eacc94ea03d0f3221559b9b (diff) |
- 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/procfs/procfs_vnops.c')
-rw-r--r-- | sys/miscfs/procfs/procfs_vnops.c | 5 |
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; } |