Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux Add ida_simple_remove.



details:   https://anonhg.NetBSD.org/src/rev/f8f2e317d6f0
branches:  trunk
changeset: 834991:f8f2e317d6f0
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:15:06 2018 +0000

description:
Add ida_simple_remove.

Same as ida_remove for us.  Linux requires caller to handle locking
for ida_remove (so it works with RCU) and ida_simple_remove just uses
a global lock where for users that aren't performance-critical.  If
we ever pserialized idr, we'd have to do the same.

diffstat:

 sys/external/bsd/drm2/include/linux/idr.h |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 35b5c7508e20 -r f8f2e317d6f0 sys/external/bsd/drm2/include/linux/idr.h
--- a/sys/external/bsd/drm2/include/linux/idr.h Mon Aug 27 07:14:55 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/idr.h Mon Aug 27 07:15:06 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: idr.h,v 1.5 2018/08/27 06:55:01 riastradh Exp $        */
+/*     $NetBSD: idr.h,v 1.6 2018/08/27 07:15:06 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -117,4 +117,12 @@
        return id;
 }
 
+static inline void
+ida_simple_remove(struct ida *ida, unsigned int id)
+{
+
+       KASSERT((int)id >= 0);
+       ida_remove(ida, id);
+}
+
 #endif  /* _LINUX_IDR_H_ */



Home | Main Index | Thread Index | Old Index