diff options
author | alc <alc@FreeBSD.org> | 1999-05-28 03:39:44 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-05-28 03:39:44 +0000 |
commit | 2bb1b6a2aefd1cb787f38007f631497be924d749 (patch) | |
tree | 1d6506efd59d763f994a9a7853d7f5a6857d1f21 /sys/vm/vm_object.c | |
parent | 86a616fa3ea79a343d3cf7025d8c0337ef459ed4 (diff) | |
download | FreeBSD-src-2bb1b6a2aefd1cb787f38007f631497be924d749.zip FreeBSD-src-2bb1b6a2aefd1cb787f38007f631497be924d749.tar.gz |
Avoid the creation of unnecessary shadow objects.
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index e53756a..0dccdf1 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_object.c,v 1.153 1999/03/14 06:36:00 alc Exp $ + * $Id: vm_object.c,v 1.154 1999/05/16 05:07:34 alc Exp $ */ /* @@ -868,6 +868,16 @@ vm_object_shadow(object, offset, length) source = *object; /* + * Don't create the new object if the old object isn't shared. + */ + + if (source->ref_count == 1 && + source->handle == NULL && + (source->type == OBJT_DEFAULT || + source->type == OBJT_SWAP)) + return; + + /* * Allocate a new object with the given length */ |