Page MenuHomeFreeBSD

D21310.diff
No OneTemporary

D21310.diff

Index: head/sys/vm/vm_object.h
===================================================================
--- head/sys/vm/vm_object.h
+++ head/sys/vm/vm_object.h
@@ -255,6 +255,10 @@
rw_wowned(&(object)->lock)
#define VM_OBJECT_WUNLOCK(object) \
rw_wunlock(&(object)->lock)
+#define VM_OBJECT_DROP(object) \
+ lock_class_rw.lc_unlock(&(object)->lock.lock_object)
+#define VM_OBJECT_PICKUP(object, state) \
+ lock_class_rw.lc_lock(&(object)->lock.lock_object, (state))
struct vnode;
Index: head/sys/vm/vm_pager.h
===================================================================
--- head/sys/vm/vm_pager.h
+++ head/sys/vm/vm_pager.h
@@ -151,7 +151,7 @@
) {
boolean_t ret;
- VM_OBJECT_ASSERT_WLOCKED(object);
+ VM_OBJECT_ASSERT_LOCKED(object);
ret = (*pagertab[object->type]->pgo_haspage)
(object, offset, before, after);
return (ret);
Index: head/sys/vm/vnode_pager.c
===================================================================
--- head/sys/vm/vnode_pager.c
+++ head/sys/vm/vnode_pager.c
@@ -355,13 +355,14 @@
{
struct vnode *vp = object->handle;
daddr_t bn;
+ uintptr_t lockstate;
int err;
daddr_t reqblock;
int poff;
int bsize;
int pagesperblock, blocksperpage;
- VM_OBJECT_ASSERT_WLOCKED(object);
+ VM_OBJECT_ASSERT_LOCKED(object);
/*
* If no vp or vp is doomed or marked transparent to VM, we do not
* have the page.
@@ -384,9 +385,9 @@
blocksperpage = (PAGE_SIZE / bsize);
reqblock = pindex * blocksperpage;
}
- VM_OBJECT_WUNLOCK(object);
+ lockstate = VM_OBJECT_DROP(object);
err = VOP_BMAP(vp, reqblock, NULL, &bn, after, before);
- VM_OBJECT_WLOCK(object);
+ VM_OBJECT_PICKUP(object, lockstate);
if (err)
return TRUE;
if (bn == -1)

File Metadata

Mime Type
text/plain
Expires
Sat, Jul 4, 3:12 AM (15 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34648210
Default Alt Text
D21310.diff (1 KB)

Event Timeline