summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-06-22 08:03:21 +0000
committeralc <alc@FreeBSD.org>2002-06-22 08:03:21 +0000
commitef43ad02fe4aa7493585e5ba821d148dab2da0a6 (patch)
treec9eb8f5ae5b4d0a359fdf52b66fd3e2f4aff7667 /sys
parent3e6234b7f895c11692cf0735b4a03973010d2ebf (diff)
downloadFreeBSD-src-ef43ad02fe4aa7493585e5ba821d148dab2da0a6.zip
FreeBSD-src-ef43ad02fe4aa7493585e5ba821d148dab2da0a6.tar.gz
o Replace GIANT_REQUIRED in swap_pager_alloc() by the acquisition and
release of Giant. (Annotate as MPSAFE.)
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/swap_pager.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index f9507e7..1beb5fe 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -366,6 +366,8 @@ swap_pager_swap_init()
* add because (I believe) it is not possible to attempt to create
* a new swap object w/handle when a default object with that handle
* already exists.
+ *
+ * MPSAFE
*/
static vm_object_t
swap_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
@@ -373,8 +375,7 @@ swap_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
{
vm_object_t object;
- GIANT_REQUIRED;
-
+ mtx_lock(&Giant);
if (handle) {
/*
* Reference existing named region or allocate new one. There
@@ -401,7 +402,7 @@ swap_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
swp_pager_meta_build(object, 0, SWAPBLK_NONE);
}
-
+ mtx_unlock(&Giant);
return (object);
}
OpenPOWER on IntegriCloud