r3008: when checking for the existance of a lock we are only doing a single
authorAndrew Tridgell <tridge@samba.org>
Sun, 17 Oct 2004 00:22:11 +0000 (00:22 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:59 +0000 (10:52 -0500)
tdb call, so there is no need to get the chainlock. This reduces the
number of tdb locking calls made on file IO
(This used to be commit 78e904c27b31d7123b521c446247d6ff558c84cc)

source3/locking/brlock.c

index 990a6a25d2fba201bc09e296662bb9c6cfbcbe4e..4c34bd7dfd9cc1517d11047bf2f010b67b091d1b 100644 (file)
@@ -563,7 +563,6 @@ BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
 
        dbuf.dptr = NULL;
 
-       tdb_chainlock(tdb, kbuf);
        dbuf = tdb_fetch(tdb, kbuf);
 
        lock.context.smbpid = smbpid;
@@ -594,12 +593,10 @@ BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
 
        /* no conflicts - we could have added it */
        SAFE_FREE(dbuf.dptr);
-       tdb_chainunlock(tdb, kbuf);
        return True;
 
  fail:
        SAFE_FREE(dbuf.dptr);
-       tdb_chainunlock(tdb, kbuf);
        return False;
 }