summaryrefslogtreecommitdiff
path: root/source4/tdb/spinlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'source4/tdb/spinlock.h')
-rw-r--r--source4/tdb/spinlock.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/tdb/spinlock.h b/source4/tdb/spinlock.h
index d6a2ac6eb8..967fe37457 100644
--- a/source4/tdb/spinlock.h
+++ b/source4/tdb/spinlock.h
@@ -1,7 +1,7 @@
#ifndef __SPINLOCK_H__
#define __SPINLOCK_H__
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -39,6 +39,8 @@ int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);
int tdb_create_rwlocks(int fd, unsigned int hash_size);
int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
+#define TDB_SPINLOCK_SIZE(hash_size) (((hash_size) + 1) * sizeof(tdb_rwlock_t))
+
#else /* !USE_SPINLOCKS */
#if 0
#define tdb_create_rwlocks(fd, hash_size) 0
@@ -50,6 +52,8 @@ int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);
int tdb_create_rwlocks(int fd, unsigned int hash_size);
#endif
int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
+#define TDB_SPINLOCK_SIZE(hash_size) 0
+
#endif
#endif