Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137280670
D21357.id61260.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.id61260.diff
View Options
Index: head/sys/vm/vm_object.c
===================================================================
--- head/sys/vm/vm_object.c
+++ head/sys/vm/vm_object.c
@@ -653,9 +653,10 @@
* recursion due to the terminate having to sync data
* to disk.
*/
- if ((object->flags & OBJ_DEAD) == 0)
+ if ((object->flags & OBJ_DEAD) == 0) {
+ vm_object_set_flag(object, OBJ_DEAD);
vm_object_terminate(object);
- else
+ } else
VM_OBJECT_WUNLOCK(object);
object = temp;
}
@@ -746,35 +747,9 @@
void
vm_object_terminate(vm_object_t object)
{
-
VM_OBJECT_ASSERT_WLOCKED(object);
-
- /*
- * Make sure no one uses us.
- */
- 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);
- }
+ KASSERT((object->flags & OBJ_DEAD) != 0,
+ ("terminating non-dead obj %p", object));
/*
* wait for the pageout daemon to be done with the object
Index: head/sys/vm/vnode_pager.c
===================================================================
--- head/sys/vm/vnode_pager.c
+++ head/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:45 AM (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25997509
Default Alt Text
D21357.id61260.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