mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ctdb-util: Rename db_wrap to tdb_wrap and make it a build subsystem
This makes it consistent with Samba, to ease transition. Update unit test code to link to with tdb_wrap instead of including db_wrap.c. There are some potential whitespace fixes in this commit that have been ignored. CTDB's lib/tdb_wrap will be deleted after the transition to Samba's lib/tdb_wrap, so there's no point polishing it too much. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
088e4ab3ac
commit
acf26089f1
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "tdb.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
#include "system/network.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "system/network.h"
|
||||
#include "system/filesys.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
|
||||
/*
|
||||
|
@ -1,20 +1,20 @@
|
||||
/*
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
|
||||
database wrap functions
|
||||
|
||||
Copyright (C) Andrew Tridgell 2004
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@ -29,7 +29,7 @@
|
||||
#include "includes.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
#include "tdb.h"
|
||||
#include "db_wrap.h"
|
||||
#include "tdb_wrap.h"
|
||||
|
||||
static struct tdb_wrap *tdb_list;
|
||||
|
||||
@ -41,7 +41,7 @@ static int tdb_wrap_destructor(struct tdb_wrap *w)
|
||||
tdb_close(w->tdb);
|
||||
DLIST_REMOVE(tdb_list, w);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const char *fmt, ...)
|
||||
{
|
||||
@ -88,7 +88,7 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
w->tdb = tdb_open_ex(name, hash_size, tdb_flags,
|
||||
w->tdb = tdb_open_ex(name, hash_size, tdb_flags,
|
||||
open_flags, mode, &log_ctx, NULL);
|
||||
if (w->tdb == NULL) {
|
||||
talloc_free(w);
|
@ -1,20 +1,20 @@
|
||||
/*
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
|
||||
database wrap headers
|
||||
|
||||
Copyright (C) Andrew Tridgell 2004
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
7
ctdb/lib/tdb_wrap/wscript_build
Executable file
7
ctdb/lib/tdb_wrap/wscript_build
Executable file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
bld.SAMBA_SUBSYSTEM('tdb-wrap',
|
||||
source='tdb_wrap.c',
|
||||
deps='tdb talloc',
|
||||
local_include=False
|
||||
)
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
bld.SAMBA_SUBSYSTEM('ctdb-util',
|
||||
source='''util.c util_file.c util_time.c db_wrap.c
|
||||
source='''util.c util_file.c util_time.c
|
||||
debug.c fault.c idtree.c signal.c
|
||||
substitute.c''',
|
||||
deps='tdb talloc',
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "system/wait.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
|
||||
|
||||
struct ctdb_control_state {
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "tdb.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
#include "system/network.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "system/wait.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "../common/rb_tree.h"
|
||||
|
||||
/*
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "include/ctdb_protocol.h"
|
||||
#include "tevent.h"
|
||||
#include "tdb.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "system/filesys.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "system/time.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "../common/rb_tree.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
#include <ctype.h>
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "includes.h"
|
||||
#include "system/filesys.h"
|
||||
#include "system/wait.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "tdb.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "system/wait.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
|
||||
|
||||
int
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "cmdline.h"
|
||||
#include "../include/ctdb_client.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "includes.h"
|
||||
#include "system/filesys.h"
|
||||
#include "system/wait.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "tdb.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
|
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "tdb.h"
|
||||
#include "ctdb_private.h"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "system/filesys.h"
|
||||
#include "system/dir.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "../common/rb_tree.h"
|
||||
|
@ -112,7 +112,6 @@ bool ctdb_sys_have_ip(ctdb_sock_addr *addr);
|
||||
|
||||
/* UTIL_OBJ */
|
||||
#include "lib/util/idtree.c"
|
||||
#include "lib/util/db_wrap.c"
|
||||
#include "lib/util/util.c"
|
||||
#include "lib/util/util_time.c"
|
||||
#include "lib/util/util_file.c"
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "popt.h"
|
||||
#include "cmdline.h"
|
||||
#include "ctdb_private.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
|
||||
#define MAXINDEX 64
|
||||
char indices[MAXINDEX];
|
||||
|
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/util/db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "system/filesys.h"
|
||||
#include "popt.h"
|
||||
#include "cmdline.h"
|
||||
|
@ -33,7 +33,6 @@ bool fast_start;
|
||||
|
||||
/* UTIL_OBJ */
|
||||
#include "lib/util/idtree.c"
|
||||
#include "lib/util/db_wrap.c"
|
||||
#include "lib/util/util.c"
|
||||
#include "lib/util/util_time.c"
|
||||
#include "lib/util/util_file.c"
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "../include/ctdb_client.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "../common/rb_tree.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
#include "lib/util/dlinklist.h"
|
||||
|
||||
#define ERR_TIMEOUT 20 /* timed out trying to reach node */
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "../include/ctdb_client.h"
|
||||
#include "../include/ctdb_private.h"
|
||||
#include "../common/rb_tree.h"
|
||||
#include "db_wrap.h"
|
||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||
|
||||
/* should be tunable */
|
||||
#define TIMELIMIT() timeval_current_ofs(10, 0)
|
||||
|
13
ctdb/wscript
13
ctdb/wscript
@ -173,6 +173,7 @@ def build(bld):
|
||||
if bld.CHECK_FOR_THIRD_PARTY():
|
||||
bld.RECURSE('third_party/popt')
|
||||
|
||||
bld.RECURSE('lib/tdb_wrap')
|
||||
bld.RECURSE('lib/util')
|
||||
|
||||
bld.RECURSE('lib/talloc')
|
||||
@ -238,7 +239,8 @@ def build(bld):
|
||||
source=bld.SUBDIR('client', 'ctdb_client.c'),
|
||||
includes='include include/internal lib/util',
|
||||
public_headers='include/ctdb_client.h',
|
||||
deps='replace popt talloc tevent tdb ctdb-util')
|
||||
deps='''replace popt talloc tevent tdb
|
||||
ctdb-util tdb-wrap''')
|
||||
|
||||
bld.SAMBA_SUBSYSTEM('ctdb-server',
|
||||
source='server/ctdbd.c ' +
|
||||
@ -451,20 +453,23 @@ def build(bld):
|
||||
|
||||
bld.SAMBA_BINARY('ctdb_takeover_tests',
|
||||
source='tests/src/ctdb_takeover_tests.c',
|
||||
deps='replace popt tdb tevent talloc ctdb-system' +
|
||||
deps='''replace popt tdb tevent talloc ctdb-system
|
||||
tdb-wrap''' +
|
||||
ib_deps,
|
||||
includes='include include/internal lib/util',
|
||||
install_path='${CTDB_TEST_LIBDIR}')
|
||||
|
||||
bld.SAMBA_BINARY('ctdb_functest',
|
||||
source='tests/src/ctdb_functest.c',
|
||||
deps='replace tdb tevent talloc popt ctdb-system',
|
||||
deps='''replace tdb tevent talloc popt ctdb-system
|
||||
tdb-wrap''',
|
||||
includes='include include/internal lib/util',
|
||||
install_path='${CTDB_TEST_LIBDIR}')
|
||||
|
||||
bld.SAMBA_BINARY('ctdb_stubtest',
|
||||
source='tests/src/ctdb_test.c',
|
||||
deps='replace tdb tevent talloc popt ctdb-system',
|
||||
deps='''replace tdb tevent talloc popt ctdb-system
|
||||
tdb-wrap''',
|
||||
includes='include include/internal lib/util',
|
||||
install_path='${CTDB_TEST_LIBDIR}')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user