Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137280965
D21357.id61091.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
D21357.id61091.diff
View Options
Index: sys/vm/vm_object.c
===================================================================
--- sys/vm/vm_object.c
+++ sys/vm/vm_object.c
@@ -752,30 +752,10 @@
/*
* Make sure no one uses us.
*/
+ KASSERT((object->flags & OBJ_DEAD) == 0 || object->type == OBJT_VNODE,
+ ("double-terminating obj %p", object));
vm_object_set_flag(object, OBJ_DEAD);
- /*
- * Clean and free the pages, as appropriate. All references to the
- * object are gone, so we don't need to lock it.
- */
- if (object->type == OBJT_VNODE) {
- struct vnode *vp = (struct vnode *)object->handle;
-
- /*
- * Clean pages and flush buffers.
- */
- vm_object_page_clean(object, 0, 0, OBJPC_SYNC);
- VM_OBJECT_WUNLOCK(object);
-
- vinvalbuf(vp, V_SAVE, 0, 0);
-
- BO_LOCK(&vp->v_bufobj);
- vp->v_bufobj.bo_flag |= BO_DEAD;
- BO_UNLOCK(&vp->v_bufobj);
-
- VM_OBJECT_WLOCK(object);
- }
-
/*
* wait for the pageout daemon to be done with the object
*/
Index: sys/vm/vnode_pager.c
===================================================================
--- sys/vm/vnode_pager.c
+++ sys/vm/vnode_pager.c
@@ -200,6 +200,21 @@
* don't double-terminate the object
*/
if ((obj->flags & OBJ_DEAD) == 0) {
+ vm_object_set_flag(obj, OBJ_DEAD);
+
+ /*
+ * Clean pages and flush buffers.
+ */
+ vm_object_page_clean(obj, 0, 0, OBJPC_SYNC);
+ VM_OBJECT_WUNLOCK(obj);
+
+ vinvalbuf(vp, V_SAVE, 0, 0);
+
+ BO_LOCK(&vp->v_bufobj);
+ vp->v_bufobj.bo_flag |= BO_DEAD;
+ BO_UNLOCK(&vp->v_bufobj);
+
+ VM_OBJECT_WLOCK(obj);
vm_object_terminate(obj);
} else {
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 23, 12:47 AM (10 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25998204
Default Alt Text
D21357.id61091.diff (1 KB)
Attached To
Mode
D21357: Move OBJT_VNODE specific code from vm_object_terminate() to vnode_destroy_vobject().
Attached
Detach File
Event Timeline
Log In to Comment