diff options
| author | Andreas Gruenbacher <agruen@linbit.com> | 2011-08-08 23:36:56 +0200 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:59:24 +0200 |
| commit | 04ac44b79464f1261164ca822b1e83eeaced215b (patch) | |
| tree | 359553d86aed8796203b9c09421bda2b42253660 /lib | |
| parent | c6419f03c9d6f1e2732b96a463b217c0b5ee1248 (diff) | |
idr: Add new function idr_is_empty()
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/idr.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -867,6 +867,16 @@ void idr_init(struct idr *idp) } EXPORT_SYMBOL(idr_init); +static int idr_has_entry(int id, void *p, void *data) +{ + return 1; +} + +bool idr_is_empty(struct idr *idp) +{ + return !idr_for_each(idp, idr_has_entry, NULL); +} +EXPORT_SYMBOL(idr_is_empty); /** * DOC: IDA description |
