vm_radix.h (226930) | vm_radix.h (226952) |
---|---|
1/* 2 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 60 unchanged lines hidden (view full) --- 69 * Functions which only work with black nodes. (object lock) 70 */ 71int vm_radix_insert(struct vm_radix *, vm_pindex_t, void *); 72void vm_radix_shrink(struct vm_radix *); 73 74/* 75 * Functions which work on specified colors. (object, vm_page_queue_free locks) 76 */ | 1/* 2 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 60 unchanged lines hidden (view full) --- 69 * Functions which only work with black nodes. (object lock) 70 */ 71int vm_radix_insert(struct vm_radix *, vm_pindex_t, void *); 72void vm_radix_shrink(struct vm_radix *); 73 74/* 75 * Functions which work on specified colors. (object, vm_page_queue_free locks) 76 */ |
77void *vm_radix_color(struct vm_radix *, vm_pindex_t, int color); 78void *vm_radix_lookup(struct vm_radix *, vm_pindex_t, int color); 79int vm_radix_lookupn(struct vm_radix *rtree, vm_pindex_t start, 80 vm_pindex_t end, int color, void **out, int cnt, vm_pindex_t *next); 81void *vm_radix_lookup_le(struct vm_radix *, vm_pindex_t, int color); 82void *vm_radix_remove(struct vm_radix *, vm_pindex_t, int color); | 77void *vm_radix_color(struct vm_radix *, vm_pindex_t, int); 78void *vm_radix_lookup(struct vm_radix *, vm_pindex_t, int); 79int vm_radix_lookupn(struct vm_radix *, vm_pindex_t, vm_pindex_t, int, 80 void **, int, vm_pindex_t *); 81void *vm_radix_lookup_le(struct vm_radix *, vm_pindex_t, int); 82void *vm_radix_remove(struct vm_radix *, vm_pindex_t, int); 83void vm_radix_foreach(struct vm_radix *, vm_pindex_t, vm_pindex_t, int, 84 void (*)(void *)); |
83 84/* 85 * Look up any entry at a position greater or equal to index. 86 */ 87static inline void * 88vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index, int color) 89{ 90 void *val; 91 92 if (vm_radix_lookupn(rtree, index, 0, color, &val, 1, &index)) 93 return (val); 94 return (NULL); 95} 96 97#endif /* !_VM_RADIX_H_ */ | 85 86/* 87 * Look up any entry at a position greater or equal to index. 88 */ 89static inline void * 90vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index, int color) 91{ 92 void *val; 93 94 if (vm_radix_lookupn(rtree, index, 0, color, &val, 1, &index)) 95 return (val); 96 return (NULL); 97} 98 99#endif /* !_VM_RADIX_H_ */ |