From owner-svn-src-head@FreeBSD.ORG Sun Jun 28 08:42:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71FA91065673; Sun, 28 Jun 2009 08:42:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 616228FC1E; Sun, 28 Jun 2009 08:42:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5S8gH3O006386; Sun, 28 Jun 2009 08:42:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5S8gH3q006384; Sun, 28 Jun 2009 08:42:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906280842.n5S8gH3q006384@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Jun 2009 08:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195131 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jun 2009 08:42:17 -0000 Author: kib Date: Sun Jun 28 08:42:17 2009 New Revision: 195131 URL: http://svn.freebsd.org/changeset/base/195131 Log: Eliminiate code duplication by calling vm_object_destroy() from vm_object_collapse(). Requested and reviewed by: alc Approved by: re (kensmith) Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Jun 28 02:23:51 2009 (r195130) +++ head/sys/vm/vm_object.c Sun Jun 28 08:42:17 2009 (r195131) @@ -1782,25 +1782,11 @@ vm_object_collapse(vm_object_t object) * and no object references within it, all that is * necessary is to dispose of it. */ - if (backing_object->uip != NULL) { - swap_release_by_uid(backing_object->charge, - backing_object->uip); - backing_object->charge = 0; - uifree(backing_object->uip); - backing_object->uip = NULL; - } - KASSERT(backing_object->ref_count == 1, ("backing_object %p was somehow re-referenced during collapse!", backing_object)); + KASSERT(backing_object->ref_count == 1, ( +"backing_object %p was somehow re-referenced during collapse!", + backing_object)); VM_OBJECT_UNLOCK(backing_object); - - mtx_lock(&vm_object_list_mtx); - TAILQ_REMOVE( - &vm_object_list, - backing_object, - object_list - ); - mtx_unlock(&vm_object_list_mtx); - - uma_zfree(obj_zone, backing_object); + vm_object_destroy(backing_object); object_collapses++; } else {