chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
32ff5bc
)
[PATCH] udev build tweaks to tdb's spinlock code
author
greg@kroah.com
<greg@kroah.com>
Thu, 23 Oct 2003 05:39:59 +0000
(22:39 -0700)
committer
Greg KH
<gregkh@suse.de>
Wed, 27 Apr 2005 04:05:23 +0000
(21:05 -0700)
tdb/spinlock.c
patch
|
blob
|
history
diff --git
a/tdb/spinlock.c
b/tdb/spinlock.c
index 4b17b1d9431e6e5022fe1d59e096c07e34945f46..9bf42adfcf9eb02d49a5085bba861bdd4f35831b 100644
(file)
--- a/
tdb/spinlock.c
+++ b/
tdb/spinlock.c
@@
-21,7
+21,7
@@
#define STANDALONE
#define TDB_DEBUG
#define HAVE_MMAP 1
#define STANDALONE
#define TDB_DEBUG
#define HAVE_MMAP 1
-
+#include "../udev.h"
#if HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
#include <config.h>
@@
-40,7
+40,6
@@
#include "tdb.h"
#include "spinlock.h"
#include "tdb.h"
#include "spinlock.h"
-#define DEBUG
#else
#include "includes.h"
#endif
#else
#include "includes.h"
#endif
@@
-299,10
+298,8
@@
static void __write_unlock(tdb_rwlock_t *rwlock)
{
__spin_lock(&rwlock->lock);
{
__spin_lock(&rwlock->lock);
-#ifdef DEBUG
if (!(rwlock->count & RWLOCK_BIAS))
if (!(rwlock->count & RWLOCK_BIAS))
- fprintf(stderr, "bug: write_unlock\n");
-#endif
+ dbg("bug: write_unlock");
rwlock->count &= ~RWLOCK_BIAS;
__spin_unlock(&rwlock->lock);
rwlock->count &= ~RWLOCK_BIAS;
__spin_unlock(&rwlock->lock);
@@
-312,13
+309,11
@@
static void __read_unlock(tdb_rwlock_t *rwlock)
{
__spin_lock(&rwlock->lock);
{
__spin_lock(&rwlock->lock);
-#ifdef DEBUG
if (!rwlock->count)
if (!rwlock->count)
-
fprintf(stderr, "bug: read_unlock\n
");
+
dbg("bug: read_unlock
");
if (rwlock->count & RWLOCK_BIAS)
if (rwlock->count & RWLOCK_BIAS)
- fprintf(stderr, "bug: read_unlock\n");
-#endif
+ dbg("bug: read_unlock");
rwlock->count--;
__spin_unlock(&rwlock->lock);
rwlock->count--;
__spin_unlock(&rwlock->lock);