summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-02-26 17:22:08 +0000
committerattilio <attilio@FreeBSD.org>2013-02-26 17:22:08 +0000
commit49f99b72515864c7f48e1d57295de7c122876049 (patch)
treed12fba4cf5910edb9bb22ed8053661fbc959e1fa /sys/vm/vm_object.c
parentd9ff8818e59c14ea0e7fc65590570396d4fdec2a (diff)
downloadFreeBSD-src-49f99b72515864c7f48e1d57295de7c122876049.zip
FreeBSD-src-49f99b72515864c7f48e1d57295de7c122876049.tar.gz
Wrap the sleeps synchronized by the vm_object lock into the specific
macro VM_OBJECT_SLEEP(). This hides some implementation details like the usage of the msleep() primitive and the necessity to access to the lock address directly. For this reason VM_OBJECT_MTX() macro is now retired. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by: pho
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 32b0779..fbfd24e 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -387,7 +387,7 @@ vm_object_pip_wait(vm_object_t object, char *waitid)
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
while (object->paging_in_progress) {
object->flags |= OBJ_PIPWNT;
- msleep(object, VM_OBJECT_MTX(object), PVM, waitid, 0);
+ VM_OBJECT_SLEEP(object, object, PVM, waitid, 0);
}
}
@@ -579,8 +579,7 @@ retry:
} else if (object->paging_in_progress) {
VM_OBJECT_UNLOCK(robject);
object->flags |= OBJ_PIPWNT;
- msleep(object,
- VM_OBJECT_MTX(object),
+ VM_OBJECT_SLEEP(object, object,
PDROP | PVM, "objde2", 0);
VM_OBJECT_LOCK(robject);
temp = robject->backing_object;
@@ -1139,8 +1138,7 @@ shadowlookup:
if (object != tobject)
VM_OBJECT_UNLOCK(object);
m->oflags |= VPO_WANTED;
- msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo",
- 0);
+ VM_OBJECT_SLEEP(tobject, m, PDROP | PVM, "madvpo" , 0);
VM_OBJECT_LOCK(object);
goto relookup;
}
@@ -1338,7 +1336,7 @@ retry:
if ((m->oflags & VPO_BUSY) || m->busy) {
VM_OBJECT_UNLOCK(new_object);
m->oflags |= VPO_WANTED;
- msleep(m, VM_OBJECT_MTX(orig_object), PVM, "spltwt", 0);
+ VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt" , 0);
VM_OBJECT_LOCK(new_object);
goto retry;
}
@@ -1496,7 +1494,7 @@ vm_object_backing_scan(vm_object_t object, int op)
if ((p->oflags & VPO_BUSY) || p->busy) {
VM_OBJECT_UNLOCK(object);
p->oflags |= VPO_WANTED;
- msleep(p, VM_OBJECT_MTX(backing_object),
+ VM_OBJECT_SLEEP(backing_object, p,
PDROP | PVM, "vmocol", 0);
VM_OBJECT_LOCK(object);
VM_OBJECT_LOCK(backing_object);
OpenPOWER on IntegriCloud