Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2018 13:15:57 +0000 (UTC)
From:      Slava Shwartsman <slavash@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341517 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201812051315.wB5DFvUJ063804@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812051315.wB5DFvUJ063804>