aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-03-13 17:59:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-13 18:21:47 -0400
commitc8615d3716fe327c2540cf514a34b227dc9b39e8 (patch)
tree2ad264bec1623c7b0cf43998b74654dd627a6e24 /include/linux
parent8e467e855ca5ed2921f290655f96ac40d5dc571c (diff)
idr: deprecate idr_pre_get() and idr_get_new[_above]()
Now that all in-kernel users are converted to ues the new alloc interface, mark the old interface deprecated. We should be able to remove these in a few releases. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/idr.h66
1 files changed, 50 insertions, 16 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 8c1f81f823c8..2640c7e99e51 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -73,8 +73,6 @@ struct idr {
73 */ 73 */
74 74
75void *idr_find_slowpath(struct idr *idp, int id); 75void *idr_find_slowpath(struct idr *idp, int id);
76int idr_pre_get(struct idr *idp, gfp_t gfp_mask);
77int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
78void idr_preload(gfp_t gfp_mask); 76void idr_preload(gfp_t gfp_mask);
79int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); 77int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask);
80int idr_for_each(struct idr *idp, 78int idr_for_each(struct idr *idp,
@@ -120,19 +118,6 @@ static inline void *idr_find(struct idr *idr, int id)
120} 118}
121 119
122/** 120/**
123 * idr_get_new - allocate new idr entry
124 * @idp: idr handle
125 * @ptr: pointer you want associated with the id
126 * @id: pointer to the allocated handle
127 *
128 * Simple wrapper around idr_get_new_above() w/ @starting_id of zero.
129 */
130static inline int idr_get_new(struct idr *idp, void *ptr, int *id)
131{
132 return idr_get_new_above(idp, ptr, 0, id);
133}
134
135/**
136 * idr_for_each_entry - iterate over an idr's elements of a given type 121 * idr_for_each_entry - iterate over an idr's elements of a given type
137 * @idp: idr handle 122 * @idp: idr handle
138 * @entry: the type * to use as cursor 123 * @entry: the type * to use as cursor
@@ -143,7 +128,56 @@ static inline int idr_get_new(struct idr *idp, void *ptr, int *id)
143 entry != NULL; \ 128 entry != NULL; \
144 ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) 129 ++id, entry = (typeof(entry))idr_get_next((idp), &(id)))
145 130
146void __idr_remove_all(struct idr *idp); /* don't use */ 131/*
132 * Don't use the following functions. These exist only to suppress
133 * deprecated warnings on EXPORT_SYMBOL()s.
134 */
135int __idr_pre_get(struct idr *idp, gfp_t gfp_mask);
136int __idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
137void __idr_remove_all(struct idr *idp);
138
139/**
140 * idr_pre_get - reserve resources for idr allocation
141 * @idp: idr handle
142 * @gfp_mask: memory allocation flags
143 *
144 * Part of old alloc interface. This is going away. Use
145 * idr_preload[_end]() and idr_alloc() instead.
146 */
147static inline int __deprecated idr_pre_get(struct idr *idp, gfp_t gfp_mask)
148{
149 return __idr_pre_get(idp, gfp_mask);
150}
151
152/**
153 * idr_get_new_above - allocate new idr entry above or equal to a start id
154 * @idp: idr handle
155 * @ptr: pointer you want associated with the id
156 * @starting_id: id to start search at
157 * @id: pointer to the allocated handle
158 *
159 * Part of old alloc interface. This is going away. Use
160 * idr_preload[_end]() and idr_alloc() instead.
161 */
162static inline int __deprecated idr_get_new_above(struct idr *idp, void *ptr,
163 int starting_id, int *id)
164{
165 return __idr_get_new_above(idp, ptr, starting_id, id);
166}
167
168/**
169 * idr_get_new - allocate new idr entry
170 * @idp: idr handle
171 * @ptr: pointer you want associated with the id
172 * @id: pointer to the allocated handle
173 *
174 * Part of old alloc interface. This is going away. Use
175 * idr_preload[_end]() and idr_alloc() instead.
176 */
177static inline int __deprecated idr_get_new(struct idr *idp, void *ptr, int *id)
178{
179 return __idr_get_new_above(idp, ptr, 0, id);
180}
147 181
148/** 182/**
149 * idr_remove_all - remove all ids from the given idr tree 183 * idr_remove_all - remove all ids from the given idr tree