Date: Fri, 4 Mar 2011 20:30:18 +0000 (UTC) From: Bruce Cran <brucec@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r219274 - stable/7/sys/vm Message-ID: <201103042030.p24KUIrA053309@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brucec Date: Fri Mar 4 20:30:18 2011 New Revision: 219274 URL: http://svn.freebsd.org/changeset/base/219274 Log: MFC r218966, r219124: Change the return type of vmspace_swap_count to a long to match the other vmspace_*_count functions. While here, clean up some style(9) issues. PR: kern/152200 Modified: stable/7/sys/vm/swap_pager.c stable/7/sys/vm/vm_map.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/swap_pager.c ============================================================================== --- stable/7/sys/vm/swap_pager.c Fri Mar 4 20:26:35 2011 (r219273) +++ stable/7/sys/vm/swap_pager.c Fri Mar 4 20:30:18 2011 (r219274) @@ -2266,23 +2266,24 @@ SYSCTL_NODE(_vm, OID_AUTO, swap_info, CT * if the VM object has any swap use at all the associated map entries * count for at least 1 swap page. */ -int +long vmspace_swap_count(struct vmspace *vmspace) { - vm_map_t map = &vmspace->vm_map; + vm_map_t map; vm_map_entry_t cur; - int count = 0; + vm_object_t object; + long count, n; - for (cur = map->header.next; cur != &map->header; cur = cur->next) { - vm_object_t object; + map = &vmspace->vm_map; + count = 0; + for (cur = map->header.next; cur != &map->header; cur = cur->next) { if ((cur->eflags & MAP_ENTRY_IS_SUB_MAP) == 0 && (object = cur->object.vm_object) != NULL) { VM_OBJECT_LOCK(object); if (object->type == OBJT_SWAP && object->un_pager.swp.swp_bcount != 0) { - int n = (cur->end - cur->start) / PAGE_SIZE; - + n = (cur->end - cur->start) / PAGE_SIZE; count += object->un_pager.swp.swp_bcount * SWAP_META_PAGES * n / object->size + 1; } Modified: stable/7/sys/vm/vm_map.h ============================================================================== --- stable/7/sys/vm/vm_map.h Fri Mar 4 20:26:35 2011 (r219273) +++ stable/7/sys/vm/vm_map.h Fri Mar 4 20:30:18 2011 (r219274) @@ -376,6 +376,6 @@ int vm_map_unwire(vm_map_t map, vm_offse int flags); int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); -int vmspace_swap_count (struct vmspace *vmspace); +long vmspace_swap_count(struct vmspace *vmspace); #endif /* _KERNEL */ #endif /* _VM_MAP_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103042030.p24KUIrA053309>