summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2008-07-23 15:12:45 +0000
committerpjd <pjd@FreeBSD.org>2008-07-23 15:12:45 +0000
commitc83fb5aadad6f7eb1e65c1cb14a7ddc2d98bd334 (patch)
treec1dfa07a535c8fb3e8ed39303db1f048bc098b2c
parent167593c766e7c9d7dc972f289a80815afde25bc3 (diff)
downloadFreeBSD-src-c83fb5aadad6f7eb1e65c1cb14a7ddc2d98bd334.zip
FreeBSD-src-c83fb5aadad6f7eb1e65c1cb14a7ddc2d98bd334.tar.gz
Back out this change, as it breaks the build and I don't have time for
a better fix today.
-rw-r--r--sys/sys/refcount.h14
1 files changed, 1 insertions, 13 deletions
diff --git a/sys/sys/refcount.h b/sys/sys/refcount.h
index df4dd41..9788fdf 100644
--- a/sys/sys/refcount.h
+++ b/sys/sys/refcount.h
@@ -32,14 +32,6 @@
#ifndef __SYS_REFCOUNT_H__
#define __SYS_REFCOUNT_H__
-#ifdef _KERNEL
-#include <sys/systm.h>
-#else
-#include <assert.h>
-#define KASSERT(exp, msg) assert(exp)
-#endif
-#include <machine/atomic.h>
-
static __inline void
refcount_init(volatile u_int *count, u_int value)
{
@@ -57,12 +49,8 @@ refcount_acquire(volatile u_int *count)
static __inline int
refcount_release(volatile u_int *count)
{
- u_int old;
- /* XXX: Should this have a rel membar? */
- old = atomic_fetchadd_int(count, -1);
- KASSERT(old > 0, ("negative refcount %p", count));
- return (old == 1);
+ return (atomic_fetchadd_int(count, -1) == 1);
}
#endif /* ! __SYS_REFCOUNT_H__ */
OpenPOWER on IntegriCloud