From 1ebfc66b2c145289d1e1314e8415d9e3c6f405ae Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 10 Mar 2008 21:08:29 +0100 Subject: Use a separate tdb for mutexes Another preparation to convert secrets.c to dbwrap: The dbwrap API does not provide a sane tdb_lock_with_timeout abstraction. In the clustered case the DC mutex is needed per-node anyway, so it is perfectly fine to use a local mutex only. (This used to be commit f94a63cd8f94490780ad9331da229c0bcb2ca5d6) --- source3/passdb/secrets.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'source3/passdb/secrets.c') diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index 2c0d648716..8448f795b4 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -1028,37 +1028,6 @@ NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains, return NT_STATUS_OK; } -/******************************************************************************* - Lock the secrets tdb based on a string - this is used as a primitive form of mutex - between smbd instances. -*******************************************************************************/ - -bool secrets_named_mutex(const char *name, unsigned int timeout) -{ - int ret = 0; - - if (!secrets_init()) { - return false; - } - - ret = tdb_lock_bystring_with_timeout(tdb, name, timeout); - if (ret == 0) { - DEBUG(10,("secrets_named_mutex: got mutex for %s\n", name )); - } - - return (ret == 0); -} - -/******************************************************************************* - Unlock a named mutex. -*******************************************************************************/ - -void secrets_named_mutex_release(const char *name) -{ - tdb_unlock_bystring(tdb, name); - DEBUG(10,("secrets_named_mutex: released mutex for %s\n", name )); -} - /******************************************************************************* Store a complete AFS keyfile into secrets.tdb. *******************************************************************************/ -- cgit