Deleted Added
full compact
vm_radix.h (226981) vm_radix.h (226983)
1/*
1/*
2 * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
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
9 * notice, this list of conditions and the following disclaimer.

--- 84 unchanged lines hidden (view full) ---

94{
95 void *val;
96
97 if (vm_radix_lookupn(rtree, index, 0, color, &val, 1, &index))
98 return (val);
99 return (NULL);
100}
101
3 * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.

--- 84 unchanged lines hidden (view full) ---

95{
96 void *val;
97
98 if (vm_radix_lookupn(rtree, index, 0, color, &val, 1, &index))
99 return (val);
100 return (NULL);
101}
102
103static inline void *
104vm_radix_last(struct vm_radix *rtree, int color)
105{
106
107 return vm_radix_lookup_le(rtree, 0, color);
108}
109
110static inline void *
111vm_radix_first(struct vm_radix *rtree, int color)
112{
113
114 return vm_radix_lookup_ge(rtree, 0, color);
115}
116
117static inline void *
118vm_radix_next(struct vm_radix *rtree, vm_pindex_t index, int color)
119{
120
121 if (index == -1)
122 return (NULL);
123 return vm_radix_lookup_ge(rtree, index + 1, color);
124}
125
126static inline void *
127vm_radix_prev(struct vm_radix *rtree, vm_pindex_t index, int color)
128{
129
130 if (index == 0)
131 return (NULL);
132 return vm_radix_lookup_le(rtree, index - 1, color);
133}
134
102#endif /* _KERNEL */
103#endif /* !_VM_RADIX_H_ */
135#endif /* _KERNEL */
136#endif /* !_VM_RADIX_H_ */