summaryrefslogtreecommitdiffstats
path: root/include/linux/idr.h
diff options
context:
space:
mode:
authorRusty Russell2011-08-04 01:21:06 +0200
committerLinus Torvalds2011-08-04 02:25:20 +0200
commit88eca0207cf1574328c3ce8c3be537a9317261bb (patch)
tree155b13f5df1e239fea2ad5512ef5b19865de4a9e /include/linux/idr.h
parenttaskstats: add_del_listener() should ignore !valid listeners (diff)
downloadkernel-qcow2-linux-88eca0207cf1574328c3ce8c3be537a9317261bb.tar.gz
kernel-qcow2-linux-88eca0207cf1574328c3ce8c3be537a9317261bb.tar.xz
kernel-qcow2-linux-88eca0207cf1574328c3ce8c3be537a9317261bb.zip
ida: simplified functions for id allocation
The current hyper-optimized functions are overkill if you simply want to allocate an id for a device. Create versions which use an internal lock. In followup patches, numerous drivers are converted to use this interface. Thanks to Tejun for feedback. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/idr.h')
-rw-r--r--include/linux/idr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 13a801f3d028..255491cf522e 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -146,6 +146,10 @@ void ida_remove(struct ida *ida, int id);
void ida_destroy(struct ida *ida);
void ida_init(struct ida *ida);
+int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
+ gfp_t gfp_mask);
+void ida_simple_remove(struct ida *ida, unsigned int id);
+
void __init idr_init_cache(void);
#endif /* __IDR_H__ */