summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-08-29 23:49:26 +0000
committerTim Potter <tpot@samba.org>2001-08-29 23:49:26 +0000
commit74bee75f10b6578b88d543fd1f62a198edb5c2f2 (patch)
tree4c0aba839a628a373b868496948bdcbb6e0c4b0d /source3
parentb3e43e047b20df684927afef5870ea5aa0a1ecd8 (diff)
downloadsamba-74bee75f10b6578b88d543fd1f62a198edb5c2f2.tar.gz
samba-74bee75f10b6578b88d543fd1f62a198edb5c2f2.tar.bz2
samba-74bee75f10b6578b88d543fd1f62a198edb5c2f2.zip
Renamed rwlock_t type to tdb_rwlock_t to avoid conflict with Solaris 8
header files. (This used to be commit 888c852f01cec89b380fdf2564444b86d396c442)
Diffstat (limited to 'source3')
-rw-r--r--source3/tdb/spinlock.c24
-rw-r--r--source3/tdb/spinlock.h2
2 files changed, 13 insertions, 13 deletions
diff --git a/source3/tdb/spinlock.c b/source3/tdb/spinlock.c
index 1cff416d76..d2ed381a17 100644
--- a/source3/tdb/spinlock.c
+++ b/source3/tdb/spinlock.c
@@ -243,7 +243,7 @@ static inline void __spin_lock(spinlock_t *lock)
}
}
-static void __read_lock(rwlock_t *rwlock)
+static void __read_lock(tdb_rwlock_t *rwlock)
{
int ntries = 0;
@@ -266,7 +266,7 @@ static void __read_lock(rwlock_t *rwlock)
}
}
-static void __write_lock(rwlock_t *rwlock)
+static void __write_lock(tdb_rwlock_t *rwlock)
{
int ntries = 0;
@@ -289,7 +289,7 @@ static void __write_lock(rwlock_t *rwlock)
}
}
-static void __write_unlock(rwlock_t *rwlock)
+static void __write_unlock(tdb_rwlock_t *rwlock)
{
__spin_lock(&rwlock->lock);
@@ -302,7 +302,7 @@ static void __write_unlock(rwlock_t *rwlock)
__spin_unlock(&rwlock->lock);
}
-static void __read_unlock(rwlock_t *rwlock)
+static void __read_unlock(tdb_rwlock_t *rwlock)
{
__spin_lock(&rwlock->lock);
@@ -323,10 +323,10 @@ static void __read_unlock(rwlock_t *rwlock)
/* lock a list in the database. list -1 is the alloc list */
int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type)
{
- rwlock_t *rwlocks;
+ tdb_rwlock_t *rwlocks;
if (!tdb->map_ptr) return -1;
- rwlocks = (rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
+ rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
switch(rw_type) {
case F_RDLCK:
@@ -346,10 +346,10 @@ int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type)
/* unlock the database. */
int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type)
{
- rwlock_t *rwlocks;
+ tdb_rwlock_t *rwlocks;
if (!tdb->map_ptr) return -1;
- rwlocks = (rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
+ rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
switch(rw_type) {
case F_RDLCK:
@@ -370,9 +370,9 @@ int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type)
int tdb_create_rwlocks(int fd, unsigned int hash_size)
{
unsigned size, i;
- rwlock_t *rwlocks;
+ tdb_rwlock_t *rwlocks;
- size = (hash_size + 1) * sizeof(rwlock_t);
+ size = (hash_size + 1) * sizeof(tdb_rwlock_t);
rwlocks = malloc(size);
if (!rwlocks)
return -1;
@@ -394,14 +394,14 @@ int tdb_create_rwlocks(int fd, unsigned int hash_size)
int tdb_clear_spinlocks(TDB_CONTEXT *tdb)
{
- rwlock_t *rwlocks;
+ tdb_rwlock_t *rwlocks;
unsigned i;
if (tdb->header.rwlocks == 0) return 0;
if (!tdb->map_ptr) return -1;
/* We're mmapped here */
- rwlocks = (rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
+ rwlocks = (tdb_rwlock_t *)((char *)tdb->map_ptr + tdb->header.rwlocks);
for(i = 0; i < tdb->header.hash_size+1; i++) {
__spin_lock_init(&rwlocks[i].lock);
rwlocks[i].count = 0;
diff --git a/source3/tdb/spinlock.h b/source3/tdb/spinlock.h
index a0dd9cbca5..d6a2ac6eb8 100644
--- a/source3/tdb/spinlock.h
+++ b/source3/tdb/spinlock.h
@@ -32,7 +32,7 @@ typedef volatile unsigned long spinlock_t;
typedef struct {
spinlock_t lock;
volatile int count;
-} rwlock_t;
+} tdb_rwlock_t;
int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type);
int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);