svn commit: r219273 - stable/8/sys/vm
Bruce Cran
brucec at FreeBSD.org
Fri Mar 4 20:26:36 UTC 2011
Author: brucec
Date: Fri Mar 4 20:26:35 2011
New Revision: 219273
URL: http://svn.freebsd.org/changeset/base/219273
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/8/sys/vm/swap_pager.c
stable/8/sys/vm/vm_map.h
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
Modified: stable/8/sys/vm/swap_pager.c
==============================================================================
--- stable/8/sys/vm/swap_pager.c Fri Mar 4 19:53:07 2011 (r219272)
+++ stable/8/sys/vm/swap_pager.c Fri Mar 4 20:26:35 2011 (r219273)
@@ -2408,23 +2408,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/8/sys/vm/vm_map.h
==============================================================================
--- stable/8/sys/vm/vm_map.h Fri Mar 4 19:53:07 2011 (r219272)
+++ stable/8/sys/vm/vm_map.h Fri Mar 4 20:26:35 2011 (r219273)
@@ -382,6 +382,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_ */
More information about the svn-src-stable-8
mailing list