[SCM] CTDB repository - branch 2.5 updated - ctdb-2.5.4-118-g1e7f259

Amitay Isaacs amitay at samba.org
Tue Mar 31 17:39:14 MDT 2015


The branch, 2.5 has been updated
       via  1e7f2597a64de43862564d54f566abfbeb3e4f28 (commit)
       via  80ea6462319264b14e423deb2f95eadd2ab499ed (commit)
       via  ee88c48289f82d3504f56649ee2a6426fcf533d9 (commit)
       via  863d6945eeec30a878cf430e015cc9211d4a043e (commit)
       via  6c30d437197128fdc39115251dc52cb02c5ca431 (commit)
       via  a313d2d32c0ea58925d4c64ee693753d772edf6e (commit)
       via  a4a903e08b41bc30f3176e993a03a834ad0dd50f (commit)
       via  fc36f1b715874e3d255b71b423315170db279c0b (commit)
       via  7e77433116e291c0bac6e2685c0811e3530bcbd7 (commit)
       via  ad10b9e5ee1409f0aae4e7483882e1f5bbb8e6e7 (commit)
       via  987c485c92d096f45669e22f5fe0ad7c6661c1e2 (commit)
       via  cbc8c9d96d652b2c5574e7f4d06dfd8cfa2d9a30 (commit)
       via  dbfb471e54dad4dc469effbc1d0a3549d3c1d93a (commit)
       via  71add0cfb985a15b8f67471cd50b1c7f9a36756b (commit)
       via  7f8d306905f3ae0ec5b0324ced54746424896f38 (commit)
      from  46069f56c93d986e173e0e0fba7e5162c7271609 (commit)

https://git.samba.org/?p=ctdb.git;a=shortlog;h=2.5


- Log -----------------------------------------------------------------
commit 1e7f2597a64de43862564d54f566abfbeb3e4f28
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 5 16:09:34 2014 +1000

    includes: Remove some unnecessary declarations
    
    To accommodate removing file_lines_load() from here, drop the #ifdef
    around the declaration in util.h.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 9726e17e366382776c87a8aaa63884665c604896)

commit 80ea6462319264b14e423deb2f95eadd2ab499ed
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Aug 16 16:17:02 2014 +1000

    logging: Move variable debug_extra from debug.*
    
    debug_extra is CTDB-specific.  Moving it will help with the
    transitions to Samba's updated debug.[ch].
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 8b39141c46458974d5476b2925f2dd5d51d9180d)

commit ee88c48289f82d3504f56649ee2a6426fcf533d9
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Sep 9 13:52:07 2014 +1000

    logging: Factor out ctdb_logging.h from includes.h
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 97dc127b81c1923755b59aad6e735aa679af3f64)

commit 863d6945eeec30a878cf430e015cc9211d4a043e
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 15 16:18:05 2014 +1000

    recoverd: Change include of dlinklist.h to contain directory
    
    This makes it consistent with the rest of the code and avoids problems
    when some variant of lib/util isn't in the include path.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 0c0f323bb3e9146dc584a461b225586670fa9c2e)

commit 6c30d437197128fdc39115251dc52cb02c5ca431
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 15 15:53:03 2014 +1000

    tools: Move definition of timeval_delta() to tools/ctdb.c
    
    This function is only used in this file.  Samba's lib/util doesn't
    have timeval_delta(), so staging a clean transition.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 6e1568149ede06d48b91bbc7ecd8c55da3b41a41)

commit a313d2d32c0ea58925d4c64ee693753d772edf6e
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 15 15:55:20 2014 +1000

    daemon: Drop the argument to fault_setup()
    
    Samba's version doesn't accept an argument, so this aids a smooth
    transition.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit c5c74e47ee672e9e9605c5c4b96733d899b6f9b6)

commit a4a903e08b41bc30f3176e993a03a834ad0dd50f
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 15 16:11:45 2014 +1000

    util: Add extra max_size argument to file_lines_load()
    
    This is part of a migration to Samba's lib/util.  CTDB always passes 0
    (i.e. no max_size) so use a simple assert() to enforce this, rather
    than changing a lot of code that will be discarded anyway.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit a4e76b58a5086e1339dea53b72437ed179e6025a)

commit fc36f1b715874e3d255b71b423315170db279c0b
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Aug 6 16:36:58 2014 +1000

    common: Move hex_decode_talloc() to the lock helper
    
    This is the only place it is used.
    
    After migrating to Samba's lib/util, the lock helper can be changed to
    use strhex_to_data_blob().
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 94a5e28ffb53a268865666038678e78cbbb39de3)

commit 7e77433116e291c0bac6e2685c0811e3530bcbd7
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 4 13:33:58 2014 +1000

    common: Add some missing #includes
    
    To avoid warnings when using --enable-developer, which uses
    -Wmissing-prototypes.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 751ad4b62561b140b7a33d66e63907411a748501)

commit ad10b9e5ee1409f0aae4e7483882e1f5bbb8e6e7
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 4 13:31:15 2014 +1000

    daemon: Move some inline declarations to header file
    
    To avoid warnings when using --enable-developer, which uses
    -Wmissing-prototypes.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit a81dccf7ad8345a1c44dc7a08e2320bd88e1aaa5)

commit 987c485c92d096f45669e22f5fe0ad7c6661c1e2
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 4 13:30:09 2014 +1000

    tests: Add missing declarations caused by #define magic
    
    Some declarations get lost because they basically get #define-d away,
    so they need to be repeated after the #undef-s.  Also, some functions
    are introduced due the #define-s.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 6336b958d61ba6901edbaddac8bc10539c8f30ab)

commit cbc8c9d96d652b2c5574e7f4d06dfd8cfa2d9a30
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 4 13:28:34 2014 +1000

    tests: Mark some functions as static
    
    To avoid warnings when using --enable-developer, which uses
    -Wmissing-prototypes.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 6674949317dd4b2c1855571ea378eb6bc3b2e86c)

commit dbfb471e54dad4dc469effbc1d0a3549d3c1d93a
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 4 12:34:46 2014 +1000

    util: Remove util/strlist.c and references to str_util_*()
    
    They're not used in CTDB.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 5de4a97fe941c27080061480cdd7ed8f60f4438e)

commit 71add0cfb985a15b8f67471cd50b1c7f9a36756b
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 4 11:21:24 2014 +1000

    Fix some "declarations after code" problems
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit b0f9d3305850bdcce171b53e7bbbc9628a4e3c20)

commit 7f8d306905f3ae0ec5b0324ced54746424896f38
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Sep 4 11:20:28 2014 +1000

    util: Variables should be declared extern in headers
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    (Imported from commit 1d16555fa0ad562dcd8c4bbffaca454e68bcabbf)

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in                      |  2 +-
 common/cmdline.c                 |  2 ++
 common/ctdb_logging.c            |  1 +
 common/system_common.c           |  2 ++
 common/system_util.c             |  1 +
 include/ctdb_logging.h           | 42 ++++++++++++++++++++++++
 include/ctdb_private.h           |  2 ++
 include/internal/includes.h      | 24 +-------------
 lib/util/db_wrap.c               |  2 +-
 lib/util/debug.c                 |  1 -
 lib/util/debug.h                 |  5 ++-
 lib/util/fault.c                 |  5 +--
 lib/util/strlist.c               | 52 -----------------------------
 lib/util/util.h                  | 71 +---------------------------------------
 lib/util/util_file.c             | 22 +++----------
 lib/util/util_time.c             |  6 ----
 server/ctdb_daemon.c             |  2 --
 server/ctdb_lock.c               |  2 +-
 server/ctdb_lock_helper.c        | 16 +++++++++
 server/ctdb_recover.c            |  3 +-
 server/ctdb_recoverd.c           |  2 +-
 server/ctdb_server.c             |  2 +-
 server/ctdb_takeover.c           |  2 +-
 server/ctdbd.c                   |  2 +-
 tests/src/ctdb_lock_tdb.c        |  2 +-
 tests/src/ctdb_porting_tests.c   |  6 ++--
 tests/src/ctdb_takeover_tests.c  | 37 +++++++++++----------
 tests/src/ctdb_test.c            | 32 ++++++++++++++++--
 tests/src/ctdb_test_stubs.c      | 20 +++++++----
 tests/src/ctdb_trackingdb_test.c |  6 ++--
 tests/src/ctdbd_test.c           |  1 -
 tests/src/rb_test.c              | 14 ++++----
 tools/ctdb.c                     |  8 ++++-
 utils/ping_pong/ping_pong.c      |  2 +-
 34 files changed, 169 insertions(+), 230 deletions(-)
 create mode 100644 include/ctdb_logging.h
 delete mode 100644 lib/util/strlist.c


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index 925ea25..01b9e50 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -81,7 +81,7 @@ LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) $(TALLOC_LIBS) $(TEVENT_LIBS) $(TD
 
 CTDB_VERSION_H = include/ctdb_version.h
 
-UTIL_OBJ = lib/util/idtree.o lib/util/db_wrap.o lib/util/strlist.o lib/util/util.o \
+UTIL_OBJ = lib/util/idtree.o lib/util/db_wrap.o lib/util/util.o \
 	lib/util/util_time.o lib/util/util_file.o lib/util/fault.o lib/util/substitute.o \
 	lib/util/signal.o
 
diff --git a/common/cmdline.c b/common/cmdline.c
index ca214b4..27c7ed9 100644
--- a/common/cmdline.c
+++ b/common/cmdline.c
@@ -25,6 +25,8 @@
 #include "../common/rb_tree.h"
 #include <ctype.h>
 
+#include "internal/cmdline.h"
+
 /* Handle common command line options for ctdb test progs
  */
 
diff --git a/common/ctdb_logging.c b/common/ctdb_logging.c
index bb80fcd..cdb049c 100644
--- a/common/ctdb_logging.c
+++ b/common/ctdb_logging.c
@@ -25,6 +25,7 @@
 
 int LogLevel = DEBUG_NOTICE;
 int this_log_level = 0;
+const char *debug_extra = "";
 
 int log_ringbuf_size;
 
diff --git a/common/system_common.c b/common/system_common.c
index 01ac2bf..899f3b5 100644
--- a/common/system_common.c
+++ b/common/system_common.c
@@ -21,6 +21,8 @@
 #include "includes.h"
 #include "system/network.h"
 
+#include "ctdb_private.h"
+
 /*
   uint16 checksum for n bytes
  */
diff --git a/common/system_util.c b/common/system_util.c
index 6fe4152..6ff82f7 100644
--- a/common/system_util.c
+++ b/common/system_util.c
@@ -24,6 +24,7 @@
 
 #include <libgen.h>
 
+#include "ctdb_private.h"
 
 #if HAVE_SCHED_H
 #include <sched.h>
diff --git a/include/ctdb_logging.h b/include/ctdb_logging.h
new file mode 100644
index 0000000..710864e
--- /dev/null
+++ b/include/ctdb_logging.h
@@ -0,0 +1,42 @@
+/*
+   ctdb logging code
+
+   Copyright (C) Andrew Tridgell  2008
+
+   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/>.
+*/
+
+#ifndef _CTDB_LOGGING_H_
+#define _CTDB_LOGGING_H_
+
+extern int LogLevel;
+extern int this_log_level;
+extern const char *debug_extra;
+
+enum debug_level {
+	DEBUG_EMERG   = -3,
+	DEBUG_ALERT   = -2,
+	DEBUG_CRIT    = -1,
+	DEBUG_ERR     =  0,
+	DEBUG_WARNING =  1,
+	DEBUG_NOTICE  =  2,
+	DEBUG_INFO    =  3,
+	DEBUG_DEBUG   =  4,
+};
+
+#define DEBUGLVL(lvl) ((lvl) <= LogLevel)
+#define DEBUG(lvl, x) do { this_log_level = (lvl); if ((lvl) < DEBUG_DEBUG) { log_ringbuffer x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0)
+#define DEBUGADD(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug_add x; }} while (0)
+
+#endif /* _CTDB_LOGGING_H_ */
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 341bad6..102168f 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -1076,6 +1076,8 @@ void ctdb_disable_monitoring(struct ctdb_context *ctdb);
 void ctdb_enable_monitoring(struct ctdb_context *ctdb);
 void ctdb_stop_monitoring(struct ctdb_context *ctdb);
 void ctdb_wait_for_first_recovery(struct ctdb_context *ctdb);
+int ctdb_tcp_init(struct ctdb_context *ctdb);
+int ctdb_ibw_init(struct ctdb_context *ctdb);
 void ctdb_start_tcp_tickle_update(struct ctdb_context *ctdb);
 void ctdb_send_keepalive(struct ctdb_context *ctdb, uint32_t destnode);
 void ctdb_start_keepalive(struct ctdb_context *ctdb);
diff --git a/include/internal/includes.h b/include/internal/includes.h
index 3747198..79d664f 100644
--- a/include/internal/includes.h
+++ b/include/internal/includes.h
@@ -18,23 +18,7 @@
 
 #include "tevent.h"
 
-extern int LogLevel;
-extern int this_log_level;
-
-enum debug_level { 
-	DEBUG_EMERG   = -3, 
-	DEBUG_ALERT   = -2, 
-	DEBUG_CRIT    = -1,
-	DEBUG_ERR     =  0,
-	DEBUG_WARNING =  1,
-	DEBUG_NOTICE  =  2,	
-	DEBUG_INFO    =  3,
-	DEBUG_DEBUG   =  4,
-};
-
-#define DEBUGLVL(lvl) ((lvl) <= LogLevel)
-#define DEBUG(lvl, x) do { this_log_level = (lvl); if ((lvl) < DEBUG_DEBUG) { log_ringbuffer x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0)
-#define DEBUGADD(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug_add x; }} while (0)
+#include "ctdb_logging.h"
 
 #define _PUBLIC_
 #define _NORETURN_
@@ -55,12 +39,6 @@ struct timeval timeval_until(const struct timeval *tv1,
 			     const struct timeval *tv2);
 _PUBLIC_ struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs);
 double timeval_elapsed(struct timeval *tv);
-double timeval_delta(struct timeval *tv2, struct timeval *tv);
-char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx);
-char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
-uint8_t *hex_decode_talloc(TALLOC_CTX *mem_ctx, const char *hex_in, size_t *len);
-_PUBLIC_ const char **str_list_add(const char **list, const char *s);
-_PUBLIC_ int set_blocking(int fd, bool set);
 
 #include "lib/util/debug.h"
 #include "lib/util/util.h"
diff --git a/lib/util/db_wrap.c b/lib/util/db_wrap.c
index 1b2bf7e..bc174a4 100644
--- a/lib/util/db_wrap.c
+++ b/lib/util/db_wrap.c
@@ -47,8 +47,8 @@ static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const ch
 {
 	if (level <= TDB_DEBUG_ERROR) {
 		va_list ap;
-		this_log_level = level;
 		char newfmt[strlen(tdb_name(tdb)) + 1 + strlen(fmt) + 1];
+		this_log_level = level;
 		sprintf(newfmt, "%s:%s", tdb_name(tdb), fmt);
 		va_start(ap, fmt);
 		do_debug_v(newfmt, ap);
diff --git a/lib/util/debug.c b/lib/util/debug.c
index e9365d8..40dda1a 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -50,7 +50,6 @@ static void _do_debug_v(const char *format, va_list ap)
 
 /* default logging function */
 void (*do_debug_v)(const char *, va_list ap) = _do_debug_v;
-const char *debug_extra = "";
 
 void do_debug(const char *format, ...)
 {
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 27490a3..f453011 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -17,9 +17,8 @@
    along with this program; if not, see <http://www.gnu.org/licenses/>.
 */
 
-void (*do_debug_v)(const char *, va_list ap);
-const char *debug_extra;
-void (*do_debug_add_v)(const char *, va_list ap);
+extern void (*do_debug_v)(const char *, va_list ap);
+extern void (*do_debug_add_v)(const char *, va_list ap);
 void log_ringbuffer(const char *format, ...);
 void do_debug(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
 void do_debug_add(const char *format, ...) PRINTF_ATTRIBUTE(1, 2);
diff --git a/lib/util/fault.c b/lib/util/fault.c
index 3dddd0e..d53eecd 100644
--- a/lib/util/fault.c
+++ b/lib/util/fault.c
@@ -197,11 +197,8 @@ _NORETURN_ static void sig_fault(int sig)
 /**
 setup our fault handlers
 **/
-_PUBLIC_ void fault_setup(const char *pname)
+_PUBLIC_ void fault_setup(void)
 {
-	if (progname == NULL) {
-		progname = pname;
-	}
 #ifdef SIGSEGV
 	CatchSignal(SIGSEGV, sig_fault);
 #endif
diff --git a/lib/util/strlist.c b/lib/util/strlist.c
deleted file mode 100644
index 48a6e45..0000000
--- a/lib/util/strlist.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-   
-   Copyright (C) Andrew Tridgell 2005
-   Copyright (C) Jelmer Vernooij 2005
-   
-   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/>.
-*/
-
-#include "includes.h"
-#include "system/locale.h"
-
-/**
-  return the number of elements in a string list
-*/
-_PUBLIC_ size_t str_list_length(const char **list)
-{
-	size_t ret;
-	for (ret=0;list && list[ret];ret++) /* noop */ ;
-	return ret;
-}
-
-
-/**
-  add an entry to a string list
-*/
-_PUBLIC_ const char **str_list_add(const char **list, const char *s)
-{
-	size_t len = str_list_length(list);
-	const char **ret;
-
-	ret = talloc_realloc(NULL, list, const char *, len+2);
-	if (ret == NULL) return NULL;
-
-	ret[len] = talloc_strdup(ret, s);
-	if (ret[len] == NULL) return NULL;
-
-	ret[len+1] = NULL;
-
-	return ret;
-}
diff --git a/lib/util/util.h b/lib/util/util.h
index 467fba8..8473cae 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -73,7 +73,7 @@ _PUBLIC_ _NORETURN_ void smb_panic(const char *why);
 /**
 setup our fault handlers
 **/
-_PUBLIC_ void fault_setup(const char *pname);
+_PUBLIC_ void fault_setup(void);
 
 /**
   register a fault handler. 
@@ -282,73 +282,6 @@ _PUBLIC_ void string_replace(char *s, char oldc, char newc);
  **/
 _PUBLIC_ bool strequal(const char *s1, const char *s2);
 
-/* The following definitions come from lib/util/util_strlist.c  */
-#ifdef _SAMBA_BUILD_
-
-/* separators for lists */
-#ifndef LIST_SEP
-#define LIST_SEP " \t,\n\r"
-#endif
-
-/**
-  build a null terminated list of strings from a input string and a
-  separator list. The separator list must contain characters less than
-  or equal to 0x2f for this to work correctly on multi-byte strings
-*/
-_PUBLIC_ char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
-
-/**
- * build a null terminated list of strings from an argv-like input string 
- * Entries are seperated by spaces and can be enclosed by quotes. 
- * Does NOT support escaping
- */
-_PUBLIC_ const char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
-
-/**
- * join a list back to one string 
- */
-_PUBLIC_ char *str_list_join(TALLOC_CTX *mem_ctx, const char **list, char seperator);
-
-/** join a list back to one (shell-like) string; entries 
- * seperated by spaces, using quotes where necessary */
-_PUBLIC_ char *str_list_join_shell(TALLOC_CTX *mem_ctx, const char **list, char sep);
-
-/**
-  return the number of elements in a string list
-*/
-_PUBLIC_ size_t str_list_length(const char * const *list);
-
-/**
-  copy a string list
-*/
-_PUBLIC_ char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
-
-/**
-   Return true if all the elements of the list match exactly.
- */
-_PUBLIC_ bool str_list_equal(const char **list1, const char **list2);
-
-/**
-  add an entry to a string list
-*/
-_PUBLIC_ const char **str_list_add(const char **list, const char *s);
-
-/**
-  remove an entry from a string list
-*/
-_PUBLIC_ void str_list_remove(const char **list, const char *s);
-
-/**
-  return true if a string is in a list
-*/
-_PUBLIC_ bool str_list_check(const char **list, const char *s);
-
-/**
-  return true if a string is in a list, case insensitively
-*/
-_PUBLIC_ bool str_list_check_ci(const char **list, const char *s);
-#endif
-
 /* The following definitions come from lib/util/util_file.c  */
 
 
@@ -386,13 +319,11 @@ mmap (if possible) or read a file
 **/
 _PUBLIC_ void *map_file(const char *fname, size_t size);
 
-#ifdef _SAMBA_BUILD_
 /**
 load a file into memory and return an array of pointers to lines in the file
 must be freed with talloc_free(). 
 **/
 _PUBLIC_ char **file_lines_load(const char *fname, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx);
-#endif
 
 /**
 load a fd into memory and return an array of pointers to lines in the file
diff --git a/lib/util/util_file.c b/lib/util/util_file.c
index 3a90201..5db0072 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -3,6 +3,8 @@
   not intended to remain part of ctdb
 */
 
+#include <assert.h>
+
 #include "includes.h"
 #include "system/filesys.h"
 
@@ -91,11 +93,13 @@ static char **file_lines_parse(char *p, size_t size, int *numlines, TALLOC_CTX *
 load a file into memory and return an array of pointers to lines in the file
 must be freed with talloc_free(). 
 **/
-_PUBLIC_ char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx)
+_PUBLIC_ char **file_lines_load(const char *fname, int *numlines, size_t maxsize, TALLOC_CTX *mem_ctx)
 {
 	char *p;
 	size_t size;
 
+	assert(maxsize == 0);
+
 	p = file_load(fname, &size, mem_ctx);
 	if (!p) return NULL;
 
@@ -114,19 +118,3 @@ char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_
 
 	return hex_buffer;
 }
-
-uint8_t *hex_decode_talloc(TALLOC_CTX *mem_ctx, const char *hex_in, size_t *len)
-{
-	int i, num;
-	uint8_t *buffer;
-
-	*len = strlen(hex_in) / 2;
-	buffer = talloc_array(mem_ctx, unsigned char, *len);
-
-	for (i=0; i<*len; i++) {
-		sscanf(&hex_in[i*2], "%02X", &num);
-		buffer[i] = (uint8_t)num;
-	}
-
-	return buffer;
-}
diff --git a/lib/util/util_time.c b/lib/util/util_time.c
index be14f26..13ddfdb 100644
--- a/lib/util/util_time.c
+++ b/lib/util/util_time.c
@@ -44,12 +44,6 @@ double timeval_elapsed(struct timeval *tv)
 	       (tv2.tv_usec - tv->tv_usec)*1.0e-6;
 }
 
-double timeval_delta(struct timeval *tv2, struct timeval *tv)
-{
-	return (tv2->tv_sec - tv->tv_sec) + 
-	       (tv2->tv_usec - tv->tv_usec)*1.0e-6;
-}
-
 /**
   return a timeval struct with the given elements
 */
diff --git a/server/ctdb_daemon.c b/server/ctdb_daemon.c
index 07cc2b7..fe995c6 100644
--- a/server/ctdb_daemon.c
+++ b/server/ctdb_daemon.c
@@ -1236,12 +1236,10 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog)
 	ctdb_run_notification_script(ctdb, "init");
 
 	if (strcmp(ctdb->transport, "tcp") == 0) {
-		int ctdb_tcp_init(struct ctdb_context *);
 		ret = ctdb_tcp_init(ctdb);
 	}
 #ifdef USE_INFINIBAND
 	if (strcmp(ctdb->transport, "ib") == 0) {
-		int ctdb_ibw_init(struct ctdb_context *);
 		ret = ctdb_ibw_init(ctdb);
 	}
 #endif
diff --git a/server/ctdb_lock.c b/server/ctdb_lock.c
index 9833a75..fd1b4db 100644
--- a/server/ctdb_lock.c
+++ b/server/ctdb_lock.c
@@ -689,7 +689,7 @@ static bool lock_helper_args(TALLOC_CTX *mem_ctx,
 /*
  * Find a lock request that can be scheduled
  */
-struct lock_context *ctdb_find_lock_context(struct ctdb_context *ctdb)
+static struct lock_context *ctdb_find_lock_context(struct ctdb_context *ctdb)
 {
 	struct lock_context *lock_ctx, *next_ctx;
 	struct ctdb_db_context *ctdb_db;
diff --git a/server/ctdb_lock_helper.c b/server/ctdb_lock_helper.c
index c68e5e7..7a09ecf 100644
--- a/server/ctdb_lock_helper.c
+++ b/server/ctdb_lock_helper.c
@@ -42,6 +42,22 @@ static void usage(void)
 		progname);
 }
 
+static uint8_t *hex_decode_talloc(TALLOC_CTX *mem_ctx,
+				  const char *hex_in, size_t *len)
+{
+	int i, num;
+	uint8_t *buffer;
+
+	*len = strlen(hex_in) / 2;
+	buffer = talloc_array(mem_ctx, unsigned char, *len);
+
+	for (i=0; i<*len; i++) {
+		sscanf(&hex_in[i*2], "%02X", &num);
+		buffer[i] = (uint8_t)num;
+	}


-- 
CTDB repository


More information about the samba-cvs mailing list