[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Mon Oct 6 06:57:02 MDT 2014


The branch, master has been updated
       via  88b2485 ctdb-build: Fix handling of public headers
       via  59c3025 ctdb-build: Change from ctdb-util to samba-util
       via  43266be ctdb-build: Add generation of Samba-style version.h
       via  ba3e2ec ctdb-build: Move generation of ctdb_version.h earlier
       via  b4589b9 ctdb-logging: Update to use Samba style debug.h/debug.c
       via  3105737 ctdb-logging: Change LogLevel to DEBUGLEVEL
       via  1c8c0be ctdb-tests: Make the fake log timestamp string easy to modify
       via  b544073 ctdb-logging: Remove log ringbuffer
      from  57bcb80 s3: lib, s3: modules: Fix compilation on Solaris.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 88b24858d887278f4787081dacff2409259fcf42
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 29 21:17:30 2014 +1000

    ctdb-build: Fix handling of public headers
    
    Add the header munging, add/package ctdb_version.h, create
    directory include/public.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Mon Oct  6 14:56:07 CEST 2014 on sn-devel-104

commit 59c30257064518aae117784f02ba73bc3221bec6
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 15 16:41:57 2014 +1000

    ctdb-build: Change from ctdb-util to samba-util
    
    Remove local lib/util and lib/tdb-wrap. Update wscript, packaging and
    includes.h.
    
    The only potentially surprising thing here is a fake samba-util
    subsystem that just depends on samba-util-core.  As explained in a
    comment:
    
      When a combined build is implemented, CTDB will wanted to build
      against samba-util rather than samba-util-core.  Similarly, other
      Samba subsystems expect samba-util.  So, for a standalone build,
      just define a fake samba-util subsystem that pulls in
      samba-util-core.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 43266be94552fe0c364e12d3c44fb54e453c123a
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 25 13:28:30 2014 +1000

    ctdb-build: Add generation of Samba-style version.h
    
    This is needed by fault.c.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit ba3e2ecf6728ecb83afbaccaed35d19e4e562806
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 25 13:21:12 2014 +1000

    ctdb-build: Move generation of ctdb_version.h earlier
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit b4589b954e1090a934fafd3f8e3c2cf1ed785c61
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Aug 19 12:15:31 2014 +1000

    ctdb-logging: Update to use Samba style debug.h/debug.c
    
    Samba's debug subsystem has changed a lot, so CTDB's logging needs
    to be rewritten to be compatible.
    
    The new debug.h/debug.c can't just be pulled in because it has some
    extra dependencies into Samba's lib/util.  For now, to support the
    smallest possible patch, implement a minimal subset of Samba's
    debug.[ch] that just supports the DEBUG_CALLBACK logtype.
    
    Define a callback for each logging method.
    
    Check later to see if debug_extra (or similar) can somehow be
    implemented using debug classes.
    
    The timestamp on CTDB CLI tool and test program DEBUG() output goes
    away, so update the unit test code to cope.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 3105737c4b38b3cb4f9408cfc82cf8b49bc3fb2e
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Sep 24 17:12:56 2014 +1000

    ctdb-logging: Change LogLevel to DEBUGLEVEL
    
    For compatibility with current Samba debug.[ch].
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 1c8c0be6f97f74169c0b46be4df2245aa631186a
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Sep 24 17:07:12 2014 +1000

    ctdb-tests: Make the fake log timestamp string easy to modify
    
    Use a variable to allow easy change of this string in case future
    logging changes modify the timestamp format or do not support
    timestamping.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit b544073653a5b54ba8ec2621c7314136656cfaeb
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 8 12:51:03 2014 +1000

    ctdb-logging: Remove log ringbuffer
    
    As far as we know, nobody uses this and it just complicates the
    logging subsystem.
    
    Remove all ringbuffer code and documentation.  Update the local
    daemons startup code correspondingly.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>

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

Summary of changes:
 ctdb/common/cmdline.c                         |    8 +-
 ctdb/common/ctdb_fork.c                       |   15 +-
 ctdb/common/ctdb_logging.c                    |  151 -------
 ctdb/config/ctdbd_wrapper                     |    1 -
 ctdb/configure.rpm                            |    2 +-
 ctdb/doc/ctdb.1.xml                           |   38 --
 ctdb/doc/ctdbd.1.xml                          |   19 -
 ctdb/doc/ctdbd.conf.5.xml                     |   10 -
 ctdb/ib/ibwrapper_test.c                      |    6 +-
 ctdb/include/ctdb_logging.h                   |    6 -
 ctdb/include/ctdb_private.h                   |   12 -
 ctdb/include/ctdb_protocol.h                  |    4 +-
 ctdb/include/internal/includes.h              |   12 +-
 {include => ctdb/include}/public/README.txt   |    0
 ctdb/lib/tdb_wrap/tdb_wrap.c                  |  106 -----
 ctdb/lib/tdb_wrap/tdb_wrap.h                  |   39 --
 ctdb/lib/tdb_wrap/wscript_build               |    7 -
 ctdb/lib/util/debug.c                         |  135 ------
 ctdb/lib/util/debug.h                         |   30 --
 ctdb/lib/util/dlinklist.h                     |  181 --------
 ctdb/lib/util/fault.c                         |  235 ----------
 ctdb/lib/util/idtree.c                        |  387 -----------------
 ctdb/lib/util/signal.c                        |  144 -------
 ctdb/lib/util/substitute.c                    |  167 --------
 ctdb/lib/util/util.c                          |   52 ---
 ctdb/lib/util/util.h                          |  565 -------------------------
 ctdb/lib/util/util_file.c                     |  120 ------
 ctdb/lib/util/util_time.c                     |  102 -----
 ctdb/lib/util/wscript_build                   |    9 -
 ctdb/packaging/RPM/ctdb.spec.in               |    3 +-
 ctdb/server/ctdb_control.c                    |   11 +-
 ctdb/server/ctdb_logging.c                    |  123 +-----
 ctdb/server/ctdb_recoverd.c                   |   54 +---
 ctdb/server/ctdbd.c                           |    1 -
 ctdb/tests/scripts/unit.sh                    |    1 +
 ctdb/tests/simple/scripts/local_daemons.bash  |    2 +-
 ctdb/tests/src/ctdb_functest.c                |    4 +-
 ctdb/tests/src/ctdb_porting_tests.c           |    2 +-
 ctdb/tests/src/ctdb_takeover_tests.c          |    4 +-
 ctdb/tests/takeover/det.001.sh                |   14 +-
 ctdb/tests/takeover/det.002.sh                |    8 +-
 ctdb/tests/takeover/det.003.sh                |    2 +-
 ctdb/tests/takeover/lcp2.004.sh               |   12 +-
 ctdb/tests/takeover/lcp2.005.sh               |  334 ++++++++--------
 ctdb/tests/takeover/lcp2.023.sh               |  132 +++---
 ctdb/tests/takeover/lcp2.024.sh               |   18 +-
 ctdb/tests/takeover/lcp2.029.sh               |    6 +-
 ctdb/tests/takeover/lcp2.031.sh               |  196 +++++-----
 ctdb/tests/takeover/nondet.001.sh             |   12 +-
 ctdb/tests/takeover/nondet.002.sh             |    6 +-
 ctdb/tests/tool/func.parse_nodestring.003.sh  |    2 +-
 ctdb/tests/tool/stubby.getcapabilities.003.sh |    2 +-
 ctdb/tests/tool/stubby.listnodes.001.sh       |    2 +-
 ctdb/tests/tool/stubby.lvsmaster.002.sh       |    2 +-
 ctdb/tests/tool/stubby.natgwlist.009.sh       |    8 +-
 ctdb/tests/tool/stubby.xpnn.003.sh            |    2 +-
 ctdb/tools/ctdb.c                             |  123 ------
 ctdb/wscript                                  |   70 +++-
 58 files changed, 483 insertions(+), 3236 deletions(-)
 copy {include => ctdb/include}/public/README.txt (100%)
 delete mode 100644 ctdb/lib/tdb_wrap/tdb_wrap.c
 delete mode 100644 ctdb/lib/tdb_wrap/tdb_wrap.h
 delete mode 100755 ctdb/lib/tdb_wrap/wscript_build
 delete mode 100644 ctdb/lib/util/debug.c
 delete mode 100644 ctdb/lib/util/debug.h
 delete mode 100644 ctdb/lib/util/dlinklist.h
 delete mode 100644 ctdb/lib/util/fault.c
 delete mode 100644 ctdb/lib/util/idtree.c
 delete mode 100644 ctdb/lib/util/signal.c
 delete mode 100644 ctdb/lib/util/substitute.c
 delete mode 100644 ctdb/lib/util/util.c
 delete mode 100644 ctdb/lib/util/util.h
 delete mode 100644 ctdb/lib/util/util_file.c
 delete mode 100644 ctdb/lib/util/util_time.c
 delete mode 100755 ctdb/lib/util/wscript_build


Changeset truncated at 500 lines:

diff --git a/ctdb/common/cmdline.c b/ctdb/common/cmdline.c
index ebe68e4..ab2b45e 100644
--- a/ctdb/common/cmdline.c
+++ b/ctdb/common/cmdline.c
@@ -97,9 +97,9 @@ struct ctdb_context *ctdb_cmdline_init(struct event_context *ev)
 
 	/* Set the debug level */
 	if (isalpha(ctdb_cmdline.debuglevel[0]) || ctdb_cmdline.debuglevel[0] == '-') { 
-		LogLevel = get_debug_by_desc(ctdb_cmdline.debuglevel);
+		DEBUGLEVEL = get_debug_by_desc(ctdb_cmdline.debuglevel);
 	} else {
-		LogLevel = strtol(ctdb_cmdline.debuglevel, NULL, 0);
+		DEBUGLEVEL = strtol(ctdb_cmdline.debuglevel, NULL, 0);
 	}
 
 	/* set up the tree to store server ids */
@@ -148,9 +148,9 @@ struct ctdb_context *ctdb_cmdline_client(struct tevent_context *ev,
 
 	/* Set the debug level */
 	if (isalpha(ctdb_cmdline.debuglevel[0]) || ctdb_cmdline.debuglevel[0] == '-') { 
-		LogLevel = get_debug_by_desc(ctdb_cmdline.debuglevel);
+		DEBUGLEVEL = get_debug_by_desc(ctdb_cmdline.debuglevel);
 	} else {
-		LogLevel = strtol(ctdb_cmdline.debuglevel, NULL, 0);
+		DEBUGLEVEL = strtol(ctdb_cmdline.debuglevel, NULL, 0);
 	}
 
 	ret = ctdb_socket_connect(ctdb);
diff --git a/ctdb/common/ctdb_fork.c b/ctdb/common/ctdb_fork.c
index d7eef76..8d38150 100644
--- a/ctdb/common/ctdb_fork.c
+++ b/ctdb/common/ctdb_fork.c
@@ -54,7 +54,7 @@ void ctdb_track_child(struct ctdb_context *ctdb, pid_t pid)
  * This function forks a child process and drops the realtime 
  * scheduler for the child process.
  */
-pid_t ctdb_fork_no_free_ringbuffer(struct ctdb_context *ctdb)
+pid_t ctdb_fork(struct ctdb_context *ctdb)
 {
 	pid_t pid;
 
@@ -95,19 +95,6 @@ pid_t ctdb_fork_no_free_ringbuffer(struct ctdb_context *ctdb)
 	return pid;
 }
 
-pid_t ctdb_fork(struct ctdb_context *ctdb)
-{
-	pid_t pid;
-
-	pid = ctdb_fork_no_free_ringbuffer(ctdb);
-	if (pid == 0) {
-		ctdb_log_ringbuffer_free();
-	}
-
-	return pid;
-}
-
-
 static void ctdb_sigchld_handler(struct tevent_context *ev,
 	struct tevent_signal *te, int signum, int count,
 	void *dont_care, 
diff --git a/ctdb/common/ctdb_logging.c b/ctdb/common/ctdb_logging.c
index 5390156..9b5103a 100644
--- a/ctdb/common/ctdb_logging.c
+++ b/ctdb/common/ctdb_logging.c
@@ -23,159 +23,8 @@
 #include "../include/ctdb_private.h"
 #include "../include/ctdb_client.h"
 
-int LogLevel = DEBUG_NOTICE;
-int this_log_level = 0;
 const char *debug_extra = "";
 
-int log_ringbuf_size;
-
-#define MAX_LOG_SIZE 128
-
-static int first_entry = 0;
-static int ringbuf_count = 0;
-
-struct ctdb_log_entry {
-	int32_t level;
-	struct timeval t;
-	char message[MAX_LOG_SIZE];
-};
-
-
-static struct ctdb_log_entry *log_entries;
-
-/*
- * this function logs all messages for all levels to a ringbuffer
- */
-static void log_ringbuffer_v(const char *format, va_list ap)
-{
-	int ret;
-	int next_entry;
-
-	if (log_entries == NULL && log_ringbuf_size != 0) {
-		/* Hope this works. We cant log anything if it doesnt anyway */
-		log_entries = malloc(sizeof(struct ctdb_log_entry) * log_ringbuf_size);
-	}
-	if (log_entries == NULL) {
-		return;
-	}
-
-	next_entry = (first_entry + ringbuf_count) % log_ringbuf_size;
-
-	if (ringbuf_count > 0 && first_entry == next_entry) {
-		first_entry = (first_entry + 1) % log_ringbuf_size;
-	}
-
-	log_entries[next_entry].message[0] = '\0';
-
-	ret = vsnprintf(&log_entries[next_entry].message[0], MAX_LOG_SIZE, format, ap);
-	if (ret == -1) {
-		return;
-	}
-	/* Log messages longer than MAX_LOG_SIZE are truncated to MAX_LOG_SIZE-1
-	 * bytes.  In that case, add a newline.
-	 */
-	if (ret >= MAX_LOG_SIZE) {
-		log_entries[next_entry].message[MAX_LOG_SIZE-2] = '\n';
-	}
-
-	log_entries[next_entry].level = this_log_level;
-	log_entries[next_entry].t = timeval_current();
-
-	if (ringbuf_count < log_ringbuf_size) {
-		ringbuf_count++;
-	}
-}
-
-void log_ringbuffer(const char *format, ...)
-{
-	va_list ap;
-
-	va_start(ap, format);
-	log_ringbuffer_v(format, ap);
-	va_end(ap);
-}
-
-void ctdb_log_ringbuffer_free(void)
-{
-	if (log_entries != NULL) {
-		free(log_entries);
-		log_entries = NULL;
-	}
-	log_ringbuf_size = 0;
-}
-
-TDB_DATA ctdb_log_ringbuffer_collect_log(TALLOC_CTX *mem_ctx,
-					 enum debug_level max_level)
-{
-	TDB_DATA data;
-	FILE *f;
-	long fsize;
-	int tmp_entry;
-	struct tm *tm;
-	char tbuf[100];
-	int i;
-
-	DEBUG(DEBUG_ERR,("Marshalling %d log entries\n", ringbuf_count));
-
-	/* dump to a file, then send the file as a blob */
-	f = tmpfile();
-	if (f == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Unable to open tmpfile - %s\n",
-				 strerror(errno)));
-		return tdb_null;
-	}
-
-	for (i=0; i<ringbuf_count; i++) {
-		tmp_entry = (first_entry + i) % log_ringbuf_size;
-
-		if (log_entries[tmp_entry].level > max_level) {
-		 	continue;
-		}
-
-		tm = localtime(&log_entries[tmp_entry].t.tv_sec);
-		strftime(tbuf, sizeof(tbuf)-1,"%Y/%m/%d %H:%M:%S", tm);
-
-		if (log_entries[tmp_entry].message[0] != '\0') {
-			fprintf(f, "%s:%s %s", tbuf,
-				get_debug_by_level(log_entries[tmp_entry].level),
-				log_entries[tmp_entry].message);
-		}
-	}
-
-	fsize = ftell(f);
-	if (fsize < 0) {
-		fclose(f);
-		DEBUG(DEBUG_ERR, ("Cannot get file size for log entries\n"));
-		return tdb_null;
-	}
-	rewind(f);
-	data.dptr = talloc_size(NULL, fsize);
-	if (data.dptr == NULL) {
-		fclose(f);
-		DEBUG(DEBUG_ERR, (__location__ " Memory allocation error\n"));
-		return tdb_null;
-	}
-	data.dsize = fread(data.dptr, 1, fsize, f);
-	fclose(f);
-
-	DEBUG(DEBUG_ERR,("Marshalling log entries into a blob of %d bytes\n", (int)data.dsize));
-
-	return data;
-}
-
-void ctdb_clear_log(struct ctdb_context *ctdb)
-{
-	first_entry = 0;
-	ringbuf_count  = 0;
-}
-
-int32_t ctdb_control_clear_log(struct ctdb_context *ctdb)
-{
-	ctdb_clear_log(ctdb);
-
-	return 0;
-}
-
 struct debug_levels debug_levels[] = {
 	{DEBUG_EMERG,	"EMERG"},
 	{DEBUG_ALERT,	"ALERT"},
diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper
index cbde6ba..c2c5c1a 100755
--- a/ctdb/config/ctdbd_wrapper
+++ b/ctdb/config/ctdbd_wrapper
@@ -129,7 +129,6 @@ build_ctdb_options ()
     maybe_set "--no-lmaster"             "$CTDB_CAPABILITY_LMASTER"   "no"
     maybe_set "--lvs --single-public-ip" "$CTDB_LVS_PUBLIC_IP"
     maybe_set "--script-log-level"       "$CTDB_SCRIPT_LOG_LEVEL"
-    maybe_set "--log-ringbuf-size"       "$CTDB_LOG_RINGBUF_SIZE"
     maybe_set "--syslog"                 "$CTDB_SYSLOG"               "yes"
     maybe_set "--max-persistent-check-errors" "$CTDB_MAX_PERSISTENT_CHECK_ERRORS"
 }
diff --git a/ctdb/configure.rpm b/ctdb/configure.rpm
index 32e6673..ff7eace 100755
--- a/ctdb/configure.rpm
+++ b/ctdb/configure.rpm
@@ -7,7 +7,7 @@ else
 fi
 
 CFLAGS="-Wall -g -D_GNU_SOURCE" ./configure \
-	--builtin-libraries=replace,popt \
+	--builtin-libraries=replace,popt,samba-debug,socket-blocking,tdb-wrap \
 	--bundled-libraries=!talloc,!tevent,!tdb \
 	--minimum-library-version=talloc:2.0.8,tdb:1.2.11,tevent:0.9.16 \
 	--prefix=/usr \
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 87840cd..efa5d85 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -1185,44 +1185,6 @@ dbid:0xb775fff6 name:secrets.tdb path:/var/ctdb/persistent/secrets.tdb.0 PERSIST
     </refsect2>
 
     <refsect2>
-      <title>getlog [<parameter>LEVEL</parameter>] [recoverd]</title>
-      <para>
-	In addition to the normal logging to a log file, CTDB also
-	keeps a in-memory ringbuffer containing the most recent log
-	entries for all log levels (except DEBUG).
-      </para>
-      <para>
-	This is useful since it allows for keeping continuous logs to a file
-	at a reasonable non-verbose level, but shortly after an incident has
-	occured, a much more detailed log can be pulled from memory. This
-	can allow you to avoid having to reproduce an issue due to the
-	on-disk logs being of insufficient detail.
-      </para>
-      <para>
-	This command extracts all messages of level or lower log level
-	from memory and prints it to the screen.  The level is not
-	specified it defaults to NOTICE.
-      </para>
-      <para>
-	By default, logs are extracted from the main CTDB daemon.  If
-	the recoverd option is given then logs are extracted from the
-	recovery daemon.
-      </para>
-    </refsect2>
-
-    <refsect2>
-      <title>clearlog [recoverd]</title>
-      <para>
-	This command clears the in-memory logging ringbuffer.
-      </para>
-      <para>
-	By default, logs are cleared in the main CTDB daemon.  If the
-	recoverd option is given then logs are cleared in the recovery
-	daemon.
-      </para>
-    </refsect2>
-
-    <refsect2>
       <title>setdbreadonly <parameter>DB</parameter></title>
       <para>
 	This command will enable the read-only record support for a
diff --git a/ctdb/doc/ctdbd.1.xml b/ctdb/doc/ctdbd.1.xml
index ab222bc..20f2d8b 100644
--- a/ctdb/doc/ctdbd.1.xml
+++ b/ctdb/doc/ctdbd.1.xml
@@ -137,25 +137,6 @@
       </varlistentry>
 
       <varlistentry>
-	<term>--log-ringbuf-size=<parameter>NUM</parameter></term>
-	<listitem>
-	  <para>
-	    Set the size of the log ringbuffer to NUM entries.
-	  </para>
-	  <para>
-	    CTDB uses an in-memory ringbuffer containing NUM most
-	    recent log entries for all log levels (except DEBUG).  The
-	    ringbugger can be useful for extracting detailed logs even
-	    if some entries are not logged to the regular logs.
-	  </para>
-	  <para>
-	    Use the <command>ctdb getlog</command> command to retrieve
-	    log entries from the ringbuffer.
-	  </para>
-	</listitem>
-      </varlistentry>
-
-      <varlistentry>
 	<term>--lvs</term>
 	<listitem>
 	  <para>
diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml
index 149aa62..e316abb 100644
--- a/ctdb/doc/ctdbd.conf.5.xml
+++ b/ctdb/doc/ctdbd.conf.5.xml
@@ -231,16 +231,6 @@
       </varlistentry>
 
       <varlistentry>
-	<term>CTDB_LOG_RINGBUF_SIZE=<parameter>NUM</parameter></term>
-	<listitem>
-	  <para>
-	    Default is 0.  Corresponds to
-	    <option>--log-ringbuf-size</option>.
-	  </para>
-	</listitem>
-      </varlistentry>
-
-      <varlistentry>
 	<term>CTDB_LVS_PUBLIC_IP=<parameter>IPADDR</parameter></term>
 	<listitem>
 	  <para>
diff --git a/ctdb/ib/ibwrapper_test.c b/ctdb/ib/ibwrapper_test.c
index 48162c3..397fdf1 100644
--- a/ctdb/ib/ibwrapper_test.c
+++ b/ctdb/ib/ibwrapper_test.c
@@ -537,7 +537,7 @@ void ibwtest_usage(struct ibwtest_ctx *tcx, char *name)
 	printf("\t-n number of messages to send [default %d]\n", tcx->nmsg);
 	printf("\t-l usec time to sleep in the main loop [default %d]\n", tcx->sleep_usec);
 	printf("\t-v max variable msg size in bytes [default %d], 0=don't send var. size\n", tcx->maxsize);
-	printf("\t-d LogLevel [default %d]\n", LogLevel);	
+	printf("\t-d LogLevel [default %d]\n", DEBUGLEVEL);
 	printf("Press ctrl+C to stop the program.\n");
 }
 
@@ -553,7 +553,7 @@ int main(int argc, char *argv[])
 	memset(tcx, 0, sizeof(struct ibwtest_ctx));
 	tcx->nsec = 0;
 	tcx->nmsg = 1000;
-	LogLevel = 0;
+	DEBUGLEVEL = 0;
 
 	/* here is the only case we can't avoid using global... */
 	testctx = tcx;
@@ -592,7 +592,7 @@ int main(int argc, char *argv[])
 			tcx->maxsize = (unsigned int)atoi(optarg);
 			break;
 		case 'd':
-			LogLevel = atoi(optarg);
+			DEBUGLEVEL = atoi(optarg);
 			break;
 		default:
 			fprintf(stderr, "ERROR: unknown option -%c\n", (char)op);
diff --git a/ctdb/include/ctdb_logging.h b/ctdb/include/ctdb_logging.h
index 710864e..c0c0266 100644
--- a/ctdb/include/ctdb_logging.h
+++ b/ctdb/include/ctdb_logging.h
@@ -20,8 +20,6 @@
 #ifndef _CTDB_LOGGING_H_
 #define _CTDB_LOGGING_H_
 
-extern int LogLevel;
-extern int this_log_level;
 extern const char *debug_extra;
 
 enum debug_level {
@@ -35,8 +33,4 @@ enum debug_level {
 	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/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 02602e1..3b6bdc7 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -1096,7 +1096,6 @@ void reset_scheduler(void);
 struct tevent_signal *ctdb_init_sigchld(struct ctdb_context *ctdb);
 void ctdb_track_child(struct ctdb_context *ctdb, pid_t pid);
 pid_t ctdb_fork(struct ctdb_context *ctdb);
-pid_t ctdb_fork_no_free_ringbuffer(struct ctdb_context *ctdb);
 void ctdb_set_child_info(TALLOC_CTX *mem_ctx, const char *child_name_fmt, ...);
 bool ctdb_is_child_process(void);
 int ctdb_kill(struct ctdb_context *ctdb, pid_t pid, int signum);
@@ -1459,17 +1458,6 @@ struct ctdb_get_log_addr {
 	int32_t level;
 };
 
-extern int log_ringbuf_size;
-
-enum debug_level;
-TDB_DATA ctdb_log_ringbuffer_collect_log(TALLOC_CTX *mem_ctx,
-					 enum debug_level max_level);
-void ctdb_collect_log(struct ctdb_context *ctdb, struct ctdb_get_log_addr *log_addr);
-void ctdb_clear_log(struct ctdb_context *ctdb);
-int32_t ctdb_control_get_log(struct ctdb_context *ctdb, TDB_DATA addr);
-int32_t ctdb_control_clear_log(struct ctdb_context *ctdb);
-void ctdb_log_ringbuffer_free(void);
-
 struct ctdb_log_state *ctdb_vfork_with_logging(TALLOC_CTX *mem_ctx,
 					       struct ctdb_context *ctdb,
 					       const char *log_prefix,
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h
index 629c91c..61d5735 100644
--- a/ctdb/include/ctdb_protocol.h
+++ b/ctdb/include/ctdb_protocol.h
@@ -386,8 +386,8 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
 		    CTDB_CONTROL_REGISTER_NOTIFY         = 114,
 		    CTDB_CONTROL_DEREGISTER_NOTIFY       = 115,
 		    CTDB_CONTROL_TRANS2_ACTIVE           = 116, /* obsolete */
-		    CTDB_CONTROL_GET_LOG		 = 117,
-		    CTDB_CONTROL_CLEAR_LOG		 = 118,
+		    CTDB_CONTROL_GET_LOG		 = 117, /* obsolete */
+		    CTDB_CONTROL_CLEAR_LOG		 = 118, /* obsolete */
 		    CTDB_CONTROL_TRANS3_COMMIT           = 119,
 		    CTDB_CONTROL_GET_DB_SEQNUM           = 120,
 		    CTDB_CONTROL_DB_SET_HEALTHY		 = 121,
diff --git a/ctdb/include/internal/includes.h b/ctdb/include/internal/includes.h
index 78eba55..d167ec7 100644
--- a/ctdb/include/internal/includes.h
+++ b/ctdb/include/internal/includes.h
@@ -38,17 +38,7 @@
 #define discard_const(ptr) ((void *)((intptr_t)(ptr)))
 #endif
 
-struct timeval timeval_zero(void);
-bool timeval_is_zero(const struct timeval *tv);
-struct timeval timeval_current(void);
-struct timeval timeval_set(uint32_t secs, uint32_t usecs);
-int timeval_compare(const struct timeval *tv1, const struct timeval *tv2);
-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);
-
 #include "lib/util/debug.h"
-#include "lib/util/util.h"
+#include "lib/util/samba_util.h"
 
 #endif /* _CTDB_INCLUDES_H */
diff --git a/include/public/README.txt b/ctdb/include/public/README.txt
similarity index 100%
copy from include/public/README.txt
copy to ctdb/include/public/README.txt
diff --git a/ctdb/lib/tdb_wrap/tdb_wrap.c b/ctdb/lib/tdb_wrap/tdb_wrap.c
deleted file mode 100644
index f39ac7a..0000000
--- a/ctdb/lib/tdb_wrap/tdb_wrap.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-   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/>.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list