mirror of
https://github.com/samba-team/samba.git
synced 2025-03-10 12:58:35 +03:00
Remove gencache_[un]lock_key
This commit is contained in:
parent
3e965d017d
commit
e5a34b2533
@ -524,8 +524,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 */
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user