diff options
author | jake <jake@FreeBSD.org> | 2000-12-13 00:17:05 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2000-12-13 00:17:05 +0000 |
commit | a4ad237eaa665b78919b8ff019591629b59df5e9 (patch) | |
tree | 43d22ede99071cd294fded182b591a4a3cb8d414 /sys/fs/procfs | |
parent | 825aa5c1b32389b54f15847261348e090c31b7fc (diff) | |
download | FreeBSD-src-a4ad237eaa665b78919b8ff019591629b59df5e9.zip FreeBSD-src-a4ad237eaa665b78919b8ff019591629b59df5e9.tar.gz |
- 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.
Diffstat (limited to 'sys/fs/procfs')
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index e37f3c2..05ad13a 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/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; } |