diff options
-rw-r--r-- | include/linux/idr.h | 63 | ||||
-rw-r--r-- | lib/idr.c | 20 |
2 files changed, 2 insertions, 81 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h index f669585c4fc5..6af3400b9b2f 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -133,69 +133,6 @@ static inline void *idr_find(struct idr *idr, int id) | |||
133 | for (id = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++id) | 133 | for (id = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++id) |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Don't use the following functions. These exist only to suppress | ||
137 | * deprecated warnings on EXPORT_SYMBOL()s. | ||
138 | */ | ||
139 | int __idr_pre_get(struct idr *idp, gfp_t gfp_mask); | ||
140 | int __idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); | ||
141 | void __idr_remove_all(struct idr *idp); | ||
142 | |||
143 | /** | ||
144 | * idr_pre_get - reserve resources for idr allocation | ||
145 | * @idp: idr handle | ||
146 | * @gfp_mask: memory allocation flags | ||
147 | * | ||
148 | * Part of old alloc interface. This is going away. Use | ||
149 | * idr_preload[_end]() and idr_alloc() instead. | ||
150 | */ | ||
151 | static inline int __deprecated idr_pre_get(struct idr *idp, gfp_t gfp_mask) | ||
152 | { | ||
153 | return __idr_pre_get(idp, gfp_mask); | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * idr_get_new_above - allocate new idr entry above or equal to a start id | ||
158 | * @idp: idr handle | ||
159 | * @ptr: pointer you want associated with the id | ||
160 | * @starting_id: id to start search at | ||
161 | * @id: pointer to the allocated handle | ||
162 | * | ||
163 | * Part of old alloc interface. This is going away. Use | ||
164 | * idr_preload[_end]() and idr_alloc() instead. | ||
165 | */ | ||
166 | static inline int __deprecated idr_get_new_above(struct idr *idp, void *ptr, | ||
167 | int starting_id, int *id) | ||
168 | { | ||
169 | return __idr_get_new_above(idp, ptr, starting_id, id); | ||
170 | } | ||
171 | |||
172 | /** | ||
173 | * idr_get_new - allocate new idr entry | ||
174 | * @idp: idr handle | ||
175 | * @ptr: pointer you want associated with the id | ||
176 | * @id: pointer to the allocated handle | ||
177 | * | ||
178 | * Part of old alloc interface. This is going away. Use | ||
179 | * idr_preload[_end]() and idr_alloc() instead. | ||
180 | */ | ||
181 | static inline int __deprecated idr_get_new(struct idr *idp, void *ptr, int *id) | ||
182 | { | ||
183 | return __idr_get_new_above(idp, ptr, 0, id); | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * idr_remove_all - remove all ids from the given idr tree | ||
188 | * @idp: idr handle | ||
189 | * | ||
190 | * If you're trying to destroy @idp, calling idr_destroy() is enough. | ||
191 | * This is going away. Don't use. | ||
192 | */ | ||
193 | static inline void __deprecated idr_remove_all(struct idr *idp) | ||
194 | { | ||
195 | __idr_remove_all(idp); | ||
196 | } | ||
197 | |||
198 | /* | ||
199 | * IDA - IDR based id allocator, use when translation from id to | 136 | * IDA - IDR based id allocator, use when translation from id to |
200 | * pointer isn't necessary. | 137 | * pointer isn't necessary. |
201 | * | 138 | * |
@@ -196,7 +196,7 @@ static void idr_mark_full(struct idr_layer **pa, int id) | |||
196 | } | 196 | } |
197 | } | 197 | } |
198 | 198 | ||
199 | int __idr_pre_get(struct idr *idp, gfp_t gfp_mask) | 199 | static int __idr_pre_get(struct idr *idp, gfp_t gfp_mask) |
200 | { | 200 | { |
201 | while (idp->id_free_cnt < MAX_IDR_FREE) { | 201 | while (idp->id_free_cnt < MAX_IDR_FREE) { |
202 | struct idr_layer *new; | 202 | struct idr_layer *new; |
@@ -207,7 +207,6 @@ int __idr_pre_get(struct idr *idp, gfp_t gfp_mask) | |||
207 | } | 207 | } |
208 | return 1; | 208 | return 1; |
209 | } | 209 | } |
210 | EXPORT_SYMBOL(__idr_pre_get); | ||
211 | 210 | ||
212 | /** | 211 | /** |
213 | * sub_alloc - try to allocate an id without growing the tree depth | 212 | * sub_alloc - try to allocate an id without growing the tree depth |
@@ -374,20 +373,6 @@ static void idr_fill_slot(struct idr *idr, void *ptr, int id, | |||
374 | idr_mark_full(pa, id); | 373 | idr_mark_full(pa, id); |
375 | } | 374 | } |
376 | 375 | ||
377 | int __idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id) | ||
378 | { | ||
379 | struct idr_layer *pa[MAX_IDR_LEVEL + 1]; | ||
380 | int rv; | ||
381 | |||
382 | rv = idr_get_empty_slot(idp, starting_id, pa, 0, idp); | ||
383 | if (rv < 0) | ||
384 | return rv == -ENOMEM ? -EAGAIN : rv; | ||
385 | |||
386 | idr_fill_slot(idp, ptr, rv, pa); | ||
387 | *id = rv; | ||
388 | return 0; | ||
389 | } | ||
390 | EXPORT_SYMBOL(__idr_get_new_above); | ||
391 | 376 | ||
392 | /** | 377 | /** |
393 | * idr_preload - preload for idr_alloc() | 378 | * idr_preload - preload for idr_alloc() |
@@ -607,7 +592,7 @@ void idr_remove(struct idr *idp, int id) | |||
607 | } | 592 | } |
608 | EXPORT_SYMBOL(idr_remove); | 593 | EXPORT_SYMBOL(idr_remove); |
609 | 594 | ||
610 | void __idr_remove_all(struct idr *idp) | 595 | static void __idr_remove_all(struct idr *idp) |
611 | { | 596 | { |
612 | int n, id, max; | 597 | int n, id, max; |
613 | int bt_mask; | 598 | int bt_mask; |
@@ -640,7 +625,6 @@ void __idr_remove_all(struct idr *idp) | |||
640 | } | 625 | } |
641 | idp->layers = 0; | 626 | idp->layers = 0; |
642 | } | 627 | } |
643 | EXPORT_SYMBOL(__idr_remove_all); | ||
644 | 628 | ||
645 | /** | 629 | /** |
646 | * idr_destroy - release all cached layers within an idr tree | 630 | * idr_destroy - release all cached layers within an idr tree |