This probably doesn't belong under drivers/infiniband, since it's completely generic. How close are the existing rbtree, radix tree and idr libraries to what you need? It might be better to slightly extend an existing kernel library rather than creating yet another API... - R.