Remove gencache_[un]lock_key
authorVolker Lendecke <vl@samba.org>
Fri, 10 Jul 2009 10:03:35 +0000 (12:03 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 7 Oct 2009 08:29:31 +0000 (10:29 +0200)
source3/include/proto.h
source3/lib/gencache.c
source3/libsmb/dsgetdcname.c

index 48fb301c51a40de8e7579277faa4eed38d08b1b1..1e6aa1dd60369b5fb8ce8251f4a63f60e5890c7a 100644 (file)
@@ -527,8 +527,6 @@ bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, bool *expired);
 bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout);
 void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr),
                       void* data, const char* keystr_pattern);
-int gencache_lock_entry( const char *key );
-void gencache_unlock_entry( const char *key );
 
 /* The following definitions come from lib/interface.c  */
 
index 0e099f0dd09a03e1859dfc2daaa7eba9b59fad8e..c94fb785419177cb7d659421a1dedaf76a4812c0 100644 (file)
@@ -483,28 +483,3 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time
        state.priv = data;
        tdb_traverse(cache, gencache_iterate_fn, &state);
 }
-
-/********************************************************************
- lock a key
-********************************************************************/
-
-int gencache_lock_entry( const char *key )
-{
-       if (!gencache_init())
-               return -1;
-
-       return tdb_lock_bystring(cache, key);
-}
-
-/********************************************************************
- unlock a key
-********************************************************************/
-
-void gencache_unlock_entry( const char *key )
-{
-       if (!gencache_init())
-               return;
-
-       tdb_unlock_bystring(cache, key);
-       return;
-}
index 221f611dc81c906538f21af877ca36b8de2a5134..103d4bbceadd391da4882416d0ed802e66f77f7f 100644 (file)
@@ -171,14 +171,8 @@ static NTSTATUS dsgetdcname_cache_store(TALLOC_CTX *mem_ctx,
 
        expire_time = time(NULL) + DSGETDCNAME_CACHE_TTL;
 
-       if (gencache_lock_entry(key) != 0) {
-               return NT_STATUS_LOCK_NOT_GRANTED;
-       }
-
        ret = gencache_set_data_blob(key, blob, expire_time);
 
-       gencache_unlock_entry(key);
-
        return ret ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
 }