summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs/procfs_map.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
committerdillon <dillon@FreeBSD.org>2001-07-04 16:20:28 +0000
commite028603b7e3e4fb35cdf00aab533f3965f4a13cc (patch)
tree7420cce169451a74c5b87963467a4aeff668ed12 /sys/fs/procfs/procfs_map.c
parent0b028660051eb7abf4306d34e7fec0e7fde86a28 (diff)
downloadFreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.zip
FreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.tar.gz
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
Diffstat (limited to 'sys/fs/procfs/procfs_map.c')
-rw-r--r--sys/fs/procfs/procfs_map.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c
index 047a67f..692594d 100644
--- a/sys/fs/procfs/procfs_map.c
+++ b/sys/fs/procfs/procfs_map.c
@@ -81,14 +81,14 @@ procfs_domap(curp, p, pfs, uio)
vm_map_entry_t entry;
char mebuffer[MEBUFFERSIZE];
+ GIANT_REQUIRED;
+
if (uio->uio_rw != UIO_READ)
return (EOPNOTSUPP);
if (uio->uio_offset != 0)
return (0);
- mtx_lock(&vm_mtx);
-
error = 0;
if (map != &curproc->p_vmspace->vm_map)
vm_map_lock_read(map);
@@ -171,17 +171,13 @@ case OBJT_DEVICE:
error = EFBIG;
break;
}
- mtx_unlock(&vm_mtx);
error = uiomove(mebuffer, len, uio);
- mtx_lock(&vm_mtx);
if (error)
break;
}
if (map != &curproc->p_vmspace->vm_map)
vm_map_unlock_read(map);
- mtx_unlock(&vm_mtx);
-
return error;
}
OpenPOWER on IntegriCloud