vm_radix.c (248424) | vm_radix.c (248428) |
---|---|
1/* 2 * Copyright (c) 2013 EMC Corp. 3 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org> 4 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 359 unchanged lines hidden (view full) --- 368 NULL, NULL, VM_RADIX_PAD, UMA_ZONE_VM | UMA_ZONE_NOFREE); 369} 370 371/* 372 * Inserts the key-value pair into the trie. 373 * Panics if the key already exists. 374 */ 375void | 1/* 2 * Copyright (c) 2013 EMC Corp. 3 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org> 4 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 359 unchanged lines hidden (view full) --- 368 NULL, NULL, VM_RADIX_PAD, UMA_ZONE_VM | UMA_ZONE_NOFREE); 369} 370 371/* 372 * Inserts the key-value pair into the trie. 373 * Panics if the key already exists. 374 */ 375void |
376vm_radix_insert(struct vm_radix *rtree, vm_pindex_t index, vm_page_t page) | 376vm_radix_insert(struct vm_radix *rtree, vm_page_t page) |
377{ | 377{ |
378 vm_pindex_t newind; | 378 vm_pindex_t index, newind; |
379 struct vm_radix_node *rnode, *tmp, *tmp2; 380 vm_page_t m; 381 int slot; 382 uint16_t clev; 383 | 379 struct vm_radix_node *rnode, *tmp, *tmp2; 380 vm_page_t m; 381 int slot; 382 uint16_t clev; 383 |
384 KASSERT(index == page->pindex, ("%s: index != page->pindex", 385 __func__)); | 384 index = page->pindex; |
386 387 /* 388 * The owner of record for root is not really important because it 389 * will never be used. 390 */ 391 rnode = vm_radix_getroot(rtree); 392 if (rnode == NULL) { 393 rnode = vm_radix_node_get(0, 1, 0); --- 365 unchanged lines hidden --- | 385 386 /* 387 * The owner of record for root is not really important because it 388 * will never be used. 389 */ 390 rnode = vm_radix_getroot(rtree); 391 if (rnode == NULL) { 392 rnode = vm_radix_node_get(0, 1, 0); --- 365 unchanged lines hidden --- |