Lock the vm_object in obj_alloc().

This commit is contained in:
Alan Cox 2003-04-19 00:30:36 +00:00
parent f78a230c3c
commit 410cfc455e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113699

View File

@ -835,8 +835,10 @@ obj_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
* This looks a little weird since we're getting one page at a time
*/
while (bytes > 0) {
VM_OBJECT_LOCK(zone->uz_obj);
p = vm_page_alloc(zone->uz_obj, pages,
VM_ALLOC_INTERRUPT);
VM_OBJECT_UNLOCK(zone->uz_obj);
if (p == NULL)
return (NULL);