git: d98f2712c7f5 - main - linuxkpi: implement ida_alloc()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 Oct 2021 10:53:42 UTC
The branch main has been updated by arichardson:
URL: https://cgit.FreeBSD.org/src/commit/?id=d98f2712c7f5e4636afa65c8c3875bbb5ff981cf
commit d98f2712c7f5e4636afa65c8c3875bbb5ff981cf
Author: Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-10-08 08:36:30 +0000
Commit: Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-10-11 10:51:44 +0000
linuxkpi: implement ida_alloc()
Needed for the virtio-gpu driver.
Reviewed By: #linuxkpi, manu, bz, hselasky
Differential Revision: https://reviews.freebsd.org/D32366
---
sys/compat/linuxkpi/common/include/linux/idr.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sys/compat/linuxkpi/common/include/linux/idr.h b/sys/compat/linuxkpi/common/include/linux/idr.h
index 7387032fd989..cba3f96c88ae 100644
--- a/sys/compat/linuxkpi/common/include/linux/idr.h
+++ b/sys/compat/linuxkpi/common/include/linux/idr.h
@@ -140,6 +140,11 @@ ida_alloc_max(struct ida *ida, unsigned int max, gfp_t gfp)
return (ida_simple_get(ida, 0, max, gfp));
}
+static inline int ida_alloc(struct ida *ida, gfp_t gfp)
+{
+ return (ida_alloc_max(ida, ~0u, gfp));
+}
+
static inline bool
ida_is_empty(struct ida *ida)
{