Author: slavash
Date: Wed Dec  5 13:15:57 2018
New Revision: 341517
URL: https://svnweb.freebsd.org/changeset/base/341517

Log:
  linuxkpi: implement idr_is_empty() and ida_is_empty().
  
  Submitted by:   kib@
  Approved by:    hselasky (mentor)
  MFC after:      1 week
  Sponsored by:   Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/idr.h

Modified: head/sys/compat/linuxkpi/common/include/linux/idr.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/idr.h Wed Dec  5 11:57:16 
2018        (r341516)
+++ head/sys/compat/linuxkpi/common/include/linux/idr.h Wed Dec  5 13:15:57 
2018        (r341517)
@@ -91,6 +91,7 @@ void  idr_init(struct idr *idp);
 int    idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t);
 int    idr_alloc_cyclic(struct idr *idp, void *ptr, int start, int end, gfp_t);
 int    idr_for_each(struct idr *idp, int (*fn)(int id, void *p, void *data), 
void *data);
+bool   idr_is_empty(struct idr *idp);
 
 #define        idr_for_each_entry(idp, entry, id)      \
        for ((id) = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++(id))
@@ -122,7 +123,15 @@ void       ida_simple_remove(struct ida *ida, unsigned int 
i
 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));
 }
 
 #endif /* _LINUX_IDR_H_ */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to