summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-01-06 11:49:13 +0000
committerkib <kib@FreeBSD.org>2017-01-06 11:49:13 +0000
commitd7631278ca66862889a9567453e14c109ac600d7 (patch)
treed41cf187a639bd06fdf8f105f3e24144d74fbaa9 /sys
parent7fda61f5af82b02d1a68155c7849ecbd9b4c06d6 (diff)
downloadFreeBSD-src-d7631278ca66862889a9567453e14c109ac600d7.zip
FreeBSD-src-d7631278ca66862889a9567453e14c109ac600d7.tar.gz
MFC r310821:
Style.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_map.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index a23468e..d615f20 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2929,8 +2929,8 @@ vm_map_entry_delete(vm_map_t map, vm_map_entry_t entry)
offidxstart = OFF_TO_IDX(entry->offset);
offidxend = offidxstart + count;
VM_OBJECT_WLOCK(object);
- if (object->ref_count != 1 &&
- ((object->flags & (OBJ_NOSPLIT|OBJ_ONEMAPPING)) == OBJ_ONEMAPPING ||
+ if (object->ref_count != 1 && ((object->flags & (OBJ_NOSPLIT |
+ OBJ_ONEMAPPING)) == OBJ_ONEMAPPING ||
object == kernel_object || object == kmem_object)) {
vm_object_collapse(object);
@@ -2943,7 +2943,8 @@ vm_map_entry_delete(vm_map_t map, vm_map_entry_t entry)
vm_object_page_remove(object, offidxstart, offidxend,
OBJPR_NOTMAPPED);
if (object->type == OBJT_SWAP)
- swap_pager_freespace(object, offidxstart, count);
+ swap_pager_freespace(object, offidxstart,
+ count);
if (offidxend >= object->size &&
offidxstart < object->size) {
size1 = object->size;
@@ -2951,8 +2952,9 @@ vm_map_entry_delete(vm_map_t map, vm_map_entry_t entry)
if (object->cred != NULL) {
size1 -= object->size;
KASSERT(object->charge >= ptoa(size1),
- ("vm_map_entry_delete: object->charge < 0"));
- swap_release_by_cred(ptoa(size1), object->cred);
+ ("object %p charge < 0", object));
+ swap_release_by_cred(ptoa(size1),
+ object->cred);
object->charge -= ptoa(size1);
}
}
@@ -3170,13 +3172,15 @@ vm_map_copy_entry(
if ((src_object = src_entry->object.vm_object) != NULL) {
VM_OBJECT_WLOCK(src_object);
charged = ENTRY_CHARGED(src_entry);
- if ((src_object->handle == NULL) &&
- (src_object->type == OBJT_DEFAULT ||
- src_object->type == OBJT_SWAP)) {
+ if (src_object->handle == NULL &&
+ (src_object->type == OBJT_DEFAULT ||
+ src_object->type == OBJT_SWAP)) {
vm_object_collapse(src_object);
- if ((src_object->flags & (OBJ_NOSPLIT|OBJ_ONEMAPPING)) == OBJ_ONEMAPPING) {
+ if ((src_object->flags & (OBJ_NOSPLIT |
+ OBJ_ONEMAPPING)) == OBJ_ONEMAPPING) {
vm_object_split(src_entry);
- src_object = src_entry->object.vm_object;
+ src_object =
+ src_entry->object.vm_object;
}
}
vm_object_reference_locked(src_object);
@@ -3203,8 +3207,10 @@ vm_map_copy_entry(
*fork_charge += size;
}
}
- src_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY);
- dst_entry->eflags |= (MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY);
+ src_entry->eflags |= MAP_ENTRY_COW |
+ MAP_ENTRY_NEEDS_COPY;
+ dst_entry->eflags |= MAP_ENTRY_COW |
+ MAP_ENTRY_NEEDS_COPY;
dst_entry->offset = src_entry->offset;
if (src_entry->eflags & MAP_ENTRY_VN_WRITECNT) {
/*
@@ -3827,10 +3833,10 @@ Retry:
rv = KERN_NO_SPACE;
/* Grow the underlying object if applicable. */
else if (stack_entry->object.vm_object == NULL ||
- vm_object_coalesce(stack_entry->object.vm_object,
- stack_entry->offset,
- (vm_size_t)(stack_entry->end - stack_entry->start),
- (vm_size_t)grow_amount, cred != NULL)) {
+ vm_object_coalesce(stack_entry->object.vm_object,
+ stack_entry->offset,
+ (vm_size_t)(stack_entry->end - stack_entry->start),
+ (vm_size_t)grow_amount, cred != NULL)) {
map->size += (addr - stack_entry->end);
/* Update the current entry. */
stack_entry->end = addr;
OpenPOWER on IntegriCloud