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 | 7e4c4721b4fbfa71ce6712ec5b9f3e8e8a105147 (patch) | |
tree | 2df359e8d49573fd79674cbb8cd592ce896a93d0 /source3/locking | |
parent | 1cd8538b7abf0970082074d7a114bb9d013d00b2 (diff) | |
download | samba-7e4c4721b4fbfa71ce6712ec5b9f3e8e8a105147.tar.gz samba-7e4c4721b4fbfa71ce6712ec5b9f3e8e8a105147.tar.bz2 samba-7e4c4721b4fbfa71ce6712ec5b9f3e8e8a105147.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.
(This used to be commit 9dea7b7c257db487f8ced7dad3fce92fba03ea91)
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/brlock.c | 26 | ||||
-rw-r--r-- | source3/locking/locking.c | 8 |
2 files changed, 17 insertions, 17 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index 979910970f..5c3dae02c0 100644 --- a/source3/locking/brlock.c +++ b/source3/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); } /**************************************************************************** diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 58e6b06e66..2056e6dcf5 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -274,7 +274,7 @@ static TDB_DATA locking_key_fsp(files_struct *fsp) BOOL lock_share_entry(connection_struct *conn, SMB_DEV_T dev, SMB_INO_T inode) { - return tdb_lockchain(tdb, locking_key(dev, inode)) == 0; + return tdb_chainlock(tdb, locking_key(dev, inode)) == 0; } /******************************************************************* @@ -283,7 +283,7 @@ BOOL lock_share_entry(connection_struct *conn, BOOL unlock_share_entry(connection_struct *conn, SMB_DEV_T dev, SMB_INO_T inode) { - return tdb_unlockchain(tdb, locking_key(dev, inode)) == 0; + return tdb_chainunlock(tdb, locking_key(dev, inode)) == 0; } @@ -292,7 +292,7 @@ BOOL unlock_share_entry(connection_struct *conn, ******************************************************************/ BOOL lock_share_entry_fsp(files_struct *fsp) { - return tdb_lockchain(tdb, locking_key(fsp->dev, fsp->inode)) == 0; + return tdb_chainlock(tdb, locking_key(fsp->dev, fsp->inode)) == 0; } /******************************************************************* @@ -300,7 +300,7 @@ BOOL lock_share_entry_fsp(files_struct *fsp) ******************************************************************/ BOOL unlock_share_entry_fsp(files_struct *fsp) { - return tdb_unlockchain(tdb, locking_key(fsp->dev, fsp->inode)) == 0; + return tdb_chainunlock(tdb, locking_key(fsp->dev, fsp->inode)) == 0; } /******************************************************************* |