Date: Tue, 03 Sep 2019 14:06:15 -0000 From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345918 - stable/12/sys/compat/linuxkpi/common/include/linux Message-ID: <201904051114.x35BER9Q001750@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Fri Apr 5 11:14:27 2019 New Revision: 345918 URL: https://svnweb.freebsd.org/changeset/base/345918 Log: MFC r345095 and r345110: Implement ida_free() and ida_alloc_max() in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/idr.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/idr.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/idr.h Fri Apr 5 11:14:01 2019 (r345917) +++ stable/12/sys/compat/linuxkpi/common/include/linux/idr.h Fri Apr 5 11:14:27 2019 (r345918) @@ -119,11 +119,25 @@ int ida_simple_get(struct ida *ida, unsigned int start gfp_t gfp_mask); void ida_simple_remove(struct ida *ida, unsigned int id); +static inline void +ida_free(struct ida *ida, int id) +{ + + ida_remove(ida, id); +} + static inline int ida_get_new(struct ida *ida, int *p_id) { return (ida_get_new_above(ida, 0, p_id)); +} + +static inline int +ida_alloc_max(struct ida *ida, unsigned int max, gfp_t gfp) +{ + + return (ida_simple_get(ida, 0, max, gfp)); } static inline bool
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904051114.x35BER9Q001750>