Add support for the (relatively) new object type OBJT_MGTDEVICE to
vm_object_set_memattr(). Also, add a "safety belt" so that vm_object_set_memattr() doesn't silently modify undefined object types. Reviewed by: kib MFC after: 10 days
This commit is contained in:
parent
371f338bfd
commit
96b0b92ac1
@ -301,6 +301,7 @@ vm_object_set_memattr(vm_object_t object, vm_memattr_t memattr)
|
||||
switch (object->type) {
|
||||
case OBJT_DEFAULT:
|
||||
case OBJT_DEVICE:
|
||||
case OBJT_MGTDEVICE:
|
||||
case OBJT_PHYS:
|
||||
case OBJT_SG:
|
||||
case OBJT_SWAP:
|
||||
@ -310,6 +311,9 @@ vm_object_set_memattr(vm_object_t object, vm_memattr_t memattr)
|
||||
break;
|
||||
case OBJT_DEAD:
|
||||
return (KERN_INVALID_ARGUMENT);
|
||||
default:
|
||||
panic("vm_object_set_memattr: object %p is of undefined type",
|
||||
object);
|
||||
}
|
||||
object->memattr = memattr;
|
||||
return (KERN_SUCCESS);
|
||||
|
Loading…
Reference in New Issue
Block a user