diff options
| author | Matthew Wilcox <[email protected]> | 2016-12-14 15:09:13 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2016-12-14 16:04:10 -0800 |
| commit | 99c494077e2d4282a17120a772eecc00ec3004cc (patch) | |
| tree | 78af69252a39b3b70879b026a6f4fbf0d8e6b5fe /include/linux | |
| parent | 3e3cdc68bede179a957fcd6be7b833a83df4e5de (diff) | |
idr: add ida_is_empty
Two of the USB Gadgets were poking around in the internals of struct ida
in order to determine if it is empty. Add the appropriate abstraction.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox <[email protected]>
Acked-by: Konstantin Khlebnikov <[email protected]>
Tested-by: Kirill A. Shutemov <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Michal Nazarewicz <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/idr.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h index 083d61e92706..3639a28188c9 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h @@ -195,6 +195,11 @@ static inline int ida_get_new(struct ida *ida, int *p_id) return ida_get_new_above(ida, 0, p_id); } +static inline bool ida_is_empty(struct ida *ida) +{ + return idr_is_empty(&ida->idr); +} + void __init idr_init_cache(void); #endif /* __IDR_H__ */ |