diff options
author | alc <alc@FreeBSD.org> | 2003-05-01 05:06:33 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-05-01 05:06:33 +0000 |
commit | 9a40fc3cd6442d4a4d2634d5203878f337a625eb (patch) | |
tree | 47626fdda62ee962a7d73c035cadc6c9be530d62 /sys/vm/vm_object.c | |
parent | 0c9f89b00abffb100cfeaa418c8a371ee0b0ec62 (diff) | |
download | FreeBSD-src-9a40fc3cd6442d4a4d2634d5203878f337a625eb.zip FreeBSD-src-9a40fc3cd6442d4a4d2634d5203878f337a625eb.tar.gz |
Extend the scope of the vm_object locking in vm_object_split().
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 822c8cf..0f38274 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1185,17 +1185,18 @@ vm_object_split(vm_map_entry_t entry) source = orig_object->backing_object; if (source != NULL) { vm_object_reference(source); /* Referenced by new_object */ + VM_OBJECT_LOCK(source); TAILQ_INSERT_TAIL(&source->shadow_head, new_object, shadow_list); - VM_OBJECT_LOCK(source); + source->shadow_count++; + source->generation++; vm_object_clear_flag(source, OBJ_ONEMAPPING); VM_OBJECT_UNLOCK(source); new_object->backing_object_offset = orig_object->backing_object_offset + offset; new_object->backing_object = source; - source->shadow_count++; - source->generation++; } + VM_OBJECT_LOCK(orig_object); for (idx = 0; idx < size; idx++) { retry: m = vm_page_lookup(orig_object, offidxstart + idx); @@ -1219,7 +1220,6 @@ vm_object_split(vm_map_entry_t entry) vm_page_busy(m); vm_page_unlock_queues(); } - VM_OBJECT_LOCK(orig_object); if (orig_object->type == OBJT_SWAP) { vm_object_pip_add(orig_object, 1); VM_OBJECT_UNLOCK(orig_object); |