diff options
author | Jeremy Allison <jra@samba.org> | 2000-12-06 00:05:15 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-12-06 00:05:15 +0000 |
commit | 9dea7b7c257db487f8ced7dad3fce92fba03ea91 (patch) | |
tree | 3fa8f299ec21342b986bee32dc40ddefc32f6c1e /source/locking/brlock.c | |
parent | c9884e16fc2d13dd62c5a43633c9a38dadc9822c (diff) | |
download | samba-9dea7b7c257db487f8ced7dad3fce92fba03ea91.tar.gz samba-9dea7b7c257db487f8ced7dad3fce92fba03ea91.tar.xz samba-9dea7b7c257db487f8ced7dad3fce92fba03ea91.zip |
Changed to sourceforge tdb code. This includes spinlocks (so we now have
a --with-spinlocks option to configure, this does mean the on-disk tdb
format has changed, so 2.2alphaX sites will need to re-create their
tdb's. The upside is no more tdb fragmentation and a +5% on netbench.
Swings and roundabouts....
Jeremy.
Diffstat (limited to 'source/locking/brlock.c')
-rw-r--r-- | source/locking/brlock.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/locking/brlock.c b/source/locking/brlock.c index 979910970fe..5c3dae02c02 100644 --- a/source/locking/brlock.c +++ b/source/locking/brlock.c @@ -121,7 +121,7 @@ static int delete_fn(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf, void *stat struct lock_key *key; int count, i; - tdb_lockchain(tdb, kbuf); + tdb_chainlock(tdb, kbuf); locks = (struct lock_struct *)dbuf.dptr; key = (struct lock_key *)kbuf.dptr; @@ -147,7 +147,7 @@ static int delete_fn(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf, void *stat tdb_store(tdb, kbuf, dbuf, TDB_REPLACE); } - tdb_unlockchain(tdb, kbuf); + tdb_chainunlock(tdb, kbuf); return 0; } @@ -188,7 +188,7 @@ BOOL brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum, dbuf.dptr = NULL; - tdb_lockchain(tdb, kbuf); + tdb_chainlock(tdb, kbuf); dbuf = tdb_fetch(tdb, kbuf); lock.context.smbpid = smbpid; @@ -218,12 +218,12 @@ BOOL brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum, tdb_store(tdb, kbuf, dbuf, TDB_REPLACE); free(dbuf.dptr); - tdb_unlockchain(tdb, kbuf); + tdb_chainunlock(tdb, kbuf); return True; fail: if (dbuf.dptr) free(dbuf.dptr); - tdb_unlockchain(tdb, kbuf); + tdb_chainunlock(tdb, kbuf); return False; } @@ -244,7 +244,7 @@ BOOL brl_unlock(SMB_DEV_T dev, SMB_INO_T ino, int fnum, dbuf.dptr = NULL; - tdb_lockchain(tdb, kbuf); + tdb_chainlock(tdb, kbuf); dbuf = tdb_fetch(tdb, kbuf); if (!dbuf.dptr) { @@ -292,7 +292,7 @@ smbpid = %u, pid = %u, tid = %u\n", } free(dbuf.dptr); - tdb_unlockchain(tdb, kbuf); + tdb_chainunlock(tdb, kbuf); return True; } } @@ -301,7 +301,7 @@ smbpid = %u, pid = %u, tid = %u\n", fail: if (dbuf.dptr) free(dbuf.dptr); - tdb_unlockchain(tdb, kbuf); + tdb_chainunlock(tdb, kbuf); return False; } @@ -322,7 +322,7 @@ BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum, dbuf.dptr = NULL; - tdb_lockchain(tdb, kbuf); + tdb_chainlock(tdb, kbuf); dbuf = tdb_fetch(tdb, kbuf); lock.context.smbpid = smbpid; @@ -346,12 +346,12 @@ BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum, /* no conflicts - we could have added it */ free(dbuf.dptr); - tdb_unlockchain(tdb, kbuf); + tdb_chainunlock(tdb, kbuf); return True; fail: if (dbuf.dptr) free(dbuf.dptr); - tdb_unlockchain(tdb, kbuf); + tdb_chainunlock(tdb, kbuf); return False; } @@ -369,7 +369,7 @@ void brl_close(SMB_DEV_T dev, SMB_INO_T ino, pid_t pid, int tid, int fnum) dbuf.dptr = NULL; - tdb_lockchain(tdb, kbuf); + tdb_chainlock(tdb, kbuf); dbuf = tdb_fetch(tdb, kbuf); if (!dbuf.dptr) goto fail; @@ -404,7 +404,7 @@ void brl_close(SMB_DEV_T dev, SMB_INO_T ino, pid_t pid, int tid, int fnum) /* we didn't find it */ fail: if (dbuf.dptr) free(dbuf.dptr); - tdb_unlockchain(tdb, kbuf); + tdb_chainunlock(tdb, kbuf); } /**************************************************************************** |