Bacula code: Total files = 438 Total lines = 154,329 (*.h *.c *.in)
+This Director and Storage daemon must be upgraded at the same time,
+but they should be compatible with all 2.0.x File daemons, unless you
+use some of the new features that affect the FD. In other words, you should
+not have to upgrade all your File daemons.
+
The major features are:
- First cut of bat (Bacula Administration Tool)
- Red/Black restore in memory tree (500 times faster loading).
/* "Generic" names for easier conversion */
#define sql_store_result(x) mysql_store_result((x)->db)
#define sql_use_result(x) mysql_use_result((x)->db)
-#define sql_free_result(x) mysql_free_result((x)->result)
+#define sql_free_result(x) my_mysql_free_result(x)
#define sql_fetch_row(x) mysql_fetch_row((x)->result)
#define sql_query(x, y) mysql_query((x)->db, (y))
#define sql_close(x) mysql_close((x)->db)
extern char* my_mysql_batch_unlock_tables_query;
extern char* my_mysql_batch_fill_filename_query;
extern char* my_mysql_batch_fill_path_query;
+extern void my_mysql_free_result(B_DB *mdb);
#else
}
+void my_mysql_free_result(B_DB *mdb)
+{
+ if (mdb->result) {
+ mysql_free_result(mdb->result);
+ mdb->result = NULL;
+ }
+}
+
char *my_mysql_batch_lock_path_query = "LOCK TABLES Path write, "
" batch write, "
" Path as p write ";
QueryDB(const char *file, int line, JCR *jcr, B_DB *mdb, char *cmd)
{
int status;
+
+ sql_free_result(mdb);
if ((status=sql_query(mdb, cmd)) != 0) {
m_msg(file, line, &mdb->errmsg, _("query %s failed:\n%s\n"), cmd, sql_strerror(mdb));
j_msg(file, line, jcr, M_FATAL, 0, "%s", mdb->errmsg);
#include "bacula.h"
#include "dird.h"
+extern void *start_sbrk;
+
static void list_scheduled_jobs(UAContext *ua);
static void list_running_jobs(UAContext *ua);
static void list_terminated_jobs(UAContext *ua);
void list_dir_status_header(UAContext *ua)
{
char dt[MAX_TIME_LENGTH];
- char b1[35], b2[35], b3[35], b4[35];
+ char b1[35], b2[35], b3[35], b4[35], b5[35];
ua->send_msg(_("%s Version: %s (%s) %s %s %s\n"), my_name, VERSION, BDATE,
HOST_OS, DISTNAME, DISTVER);
ua->send_msg(_("Daemon started %s, %d Jobs run since started.\n"),
dt, num_jobs_run);
}
- ua->send_msg(_(" Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
- edit_uint64_with_commas(sm_bytes, b1),
- edit_uint64_with_commas(sm_max_bytes, b2),
- edit_uint64_with_commas(sm_buffers, b3),
- edit_uint64_with_commas(sm_max_buffers, b4));
+ ua->send_msg(_(" Heap: sbrk=%s bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
+ edit_uint64_with_commas((uint64_t)sbrk(0)-(uint64_t)start_sbrk, b1),
+ edit_uint64_with_commas(sm_bytes, b2),
+ edit_uint64_with_commas(sm_max_bytes, b3),
+ edit_uint64_with_commas(sm_buffers, b4),
+ edit_uint64_with_commas(sm_max_buffers, b5));
}
static void do_director_status(UAContext *ua)
/* Exported globals */
time_t watchdog_time = 0; /* this has granularity of SLEEP_TIME */
time_t watchdog_sleep_time = 60; /* examine things every 60 seconds */
+void *start_sbrk;
/* Locals */
static pthread_mutex_t timer_mutex = PTHREAD_MUTEX_INITIALIZER;
if (wd_is_init) {
return 0;
}
+ start_sbrk = sbrk(0);
Dmsg0(800, "Initialising NicB-hacked watchdog thread\n");
watchdog_time = time(NULL);