Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161356775
D21310.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21310.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21310: Allow calls to vm_pager_haspages with the object read locked
Attached
Detach File
Event Timeline
Log In to Comment