From dbf03959244c392073281c10badd2095397ad2f2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 29 Oct 2004 07:29:26 +0000 Subject: r3357: removed the need to use TDB_CLEAR_IF_FIRST in Samba4. We found a few months ago that TDB_CLEAR_IF_FIRST is extremely inefficient for large numbers of connections, due to a fundamental limitation in the way posix byte range locking is implemented. Rather than the nasty workaround we had for Samba3, we now have a single "cleanup tmp files" function that runs when smbd starts. That deletes the tmp tdbs, so TDB_CLEAR_IF_FIRST is not needed at all. (This used to be commit ffa285bc783c775a2d53a58fb691ca339e6c76ae) --- source4/lib/util.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/util.c b/source4/lib/util.c index d7c5661f7d..8b27bf070c 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -705,15 +705,18 @@ char *name_to_fqdn(TALLOC_CTX *mem_ctx, const char *name) char *lock_path(TALLOC_CTX* mem_ctx, const char *name) { - char *fname; + char *fname, *dname; - fname = talloc_strdup(mem_ctx, lp_lockdir()); - trim_string(fname,"","/"); + dname = talloc_strdup(mem_ctx, lp_lockdir()); + trim_string(dname,"","/"); - if (!directory_exist(fname,NULL)) - mkdir(fname,0755); + if (!directory_exist(dname,NULL)) { + mkdir(dname,0755); + } - fname = talloc_asprintf(mem_ctx, "%s/%s", fname, name); + fname = talloc_asprintf(mem_ctx, "%s/%s", dname, name); + + talloc_free(dname); return fname; } -- cgit