Merge tag 'block-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / lib / memregion.c
blobbe5cfa5a3b570e31dc8cdec19097f1ea6609f689
1 // SPDX-License-Identifier: GPL-2.0-only
2 /* identifiers for device / performance-differentiated memory regions */
3 #include <linux/idr.h>
4 #include <linux/types.h>
5 #include <linux/memregion.h>
7 static DEFINE_IDA(memregion_ids);
9 int memregion_alloc(gfp_t gfp)
11 return ida_alloc(&memregion_ids, gfp);
13 EXPORT_SYMBOL(memregion_alloc);
15 void memregion_free(int id)
17 ida_free(&memregion_ids, id);
19 EXPORT_SYMBOL(memregion_free);