Skip to content

Commit

Permalink
storage: continue namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Aug 16, 2018
1 parent 5d34372 commit 56da487
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 71 deletions.
18 changes: 9 additions & 9 deletions core/src/stored/bcopy.cc
Expand Up @@ -108,10 +108,10 @@ int main (int argc, char *argv[])
break;

case 'c': /* specify config file */
if (configfile != NULL) {
free(configfile);
if (storagedaemon::configfile != NULL) {
free(storagedaemon::configfile);
}
configfile = bstrdup(optarg);
storagedaemon::configfile = bstrdup(optarg);
break;

case 'D': /* specify director name */
Expand Down Expand Up @@ -171,8 +171,8 @@ int main (int argc, char *argv[])

working_directory = wd;

my_config = InitSdConfig(configfile, M_ERROR_TERM);
ParseSdConfig(configfile, M_ERROR_TERM);
my_config = InitSdConfig(storagedaemon::configfile, M_ERROR_TERM);
ParseSdConfig(storagedaemon::configfile, M_ERROR_TERM);

if (DirectorName) {
foreach_res(director, R_DIRECTOR) {
Expand All @@ -182,14 +182,14 @@ int main (int argc, char *argv[])
}
if (!director) {
Emsg2(M_ERROR_TERM, 0, _("No Director resource named %s defined in %s. Cannot continue.\n"),
DirectorName, configfile);
DirectorName, storagedaemon::configfile);
}
}

LoadSdPlugins(me->plugin_directory, me->plugin_names);
LoadSdPlugins(storagedaemon::me->plugin_directory, storagedaemon::me->plugin_names);

ReadCryptoCache(me->working_directory, "bareos-sd",
GetFirstPortHostOrder(me->SDaddrs));
ReadCryptoCache(storagedaemon::me->working_directory, "bareos-sd",
GetFirstPortHostOrder(storagedaemon::me->SDaddrs));

/*
* Setup and acquire input device for reading
Expand Down
14 changes: 7 additions & 7 deletions core/src/stored/bextract.cc
Expand Up @@ -45,7 +45,7 @@
#include "lib/bsignal.h"
#include "include/jcr.h"

extern bool ParseSdConfig(const char *configfile, int exit_code);
extern bool ParseSdConfig(const char *storagedaemon::configfile, int exit_code);

static void DoExtract(char *devname);
static bool RecordCb(DeviceControlRecord *dcr, DeviceRecord *rec);
Expand Down Expand Up @@ -127,10 +127,10 @@ int main (int argc, char *argv[])
break;

case 'c': /* specify config file */
if (configfile != NULL) {
free(configfile);
if (storagedaemon::configfile != NULL) {
free(storagedaemon::configfile);
}
configfile = bstrdup(optarg);
storagedaemon::configfile = bstrdup(optarg);
break;

case 'D': /* specify director name */
Expand Down Expand Up @@ -208,8 +208,8 @@ int main (int argc, char *argv[])
usage();
}

my_config = InitSdConfig(configfile, M_ERROR_TERM);
ParseSdConfig(configfile, M_ERROR_TERM);
my_config = InitSdConfig(storagedaemon::configfile, M_ERROR_TERM);
ParseSdConfig(storagedaemon::configfile, M_ERROR_TERM);

if (DirectorName) {
foreach_res(director, R_DIRECTOR) {
Expand All @@ -219,7 +219,7 @@ int main (int argc, char *argv[])
}
if (!director) {
Emsg2(M_ERROR_TERM, 0, _("No Director resource named %s defined in %s. Cannot continue.\n"),
DirectorName, configfile);
DirectorName, storagedaemon::configfile);
}
}

Expand Down
16 changes: 8 additions & 8 deletions core/src/stored/bscan.cc
Expand Up @@ -48,7 +48,7 @@
#include "include/jcr.h"

/* Dummy functions */
extern bool ParseSdConfig(const char *configfile, int exit_code);
extern bool ParseSdConfig(const char *storagedaemon::configfile, int exit_code);

/* Forward referenced functions */
static void do_scan(void);
Expand Down Expand Up @@ -180,10 +180,10 @@ int main (int argc, char *argv[])
break;

case 'c': /* specify config file */
if (configfile != NULL) {
free(configfile);
if (storagedaemon::configfile != NULL) {
free(storagedaemon::configfile);
}
configfile = bstrdup(optarg);
storagedaemon::configfile = bstrdup(optarg);
break;

case 'D': /* specify director name */
Expand Down Expand Up @@ -270,8 +270,8 @@ int main (int argc, char *argv[])
usage();
}

my_config = InitSdConfig(configfile, M_ERROR_TERM);
ParseSdConfig(configfile, M_ERROR_TERM);
my_config = InitSdConfig(storagedaemon::configfile, M_ERROR_TERM);
ParseSdConfig(storagedaemon::configfile, M_ERROR_TERM);

if (DirectorName) {
foreach_res(director, R_DIRECTOR) {
Expand All @@ -281,7 +281,7 @@ int main (int argc, char *argv[])
}
if (!director) {
Emsg2(M_ERROR_TERM, 0, _("No Director resource named %s defined in %s. Cannot continue.\n"),
DirectorName, configfile);
DirectorName, storagedaemon::configfile);
}
}

Expand All @@ -295,7 +295,7 @@ int main (int argc, char *argv[])
working_directory = wd;
} else if (!me->working_directory) {
Emsg1(M_ERROR_TERM, 0, _("No Working Directory defined in %s. Cannot continue.\n"),
configfile);
storagedaemon::configfile);
} else {
working_directory = me->working_directory;
}
Expand Down
18 changes: 9 additions & 9 deletions core/src/stored/btape.cc
Expand Up @@ -50,7 +50,7 @@
#include "include/jcr.h"

/* Dummy functions */
extern bool ParseSdConfig(const char *configfile, int exit_code);
extern bool ParseSdConfig(const char *storagedaemon::configfile, int exit_code);

/* Exported variables */
int quit = 0;
Expand Down Expand Up @@ -212,10 +212,10 @@ int main(int margc, char *margv[])
break;

case 'c': /* specify config file */
if (configfile != NULL) {
free(configfile);
if (storagedaemon::configfile != NULL) {
free(storagedaemon::configfile);
}
configfile = bstrdup(optarg);
storagedaemon::configfile = bstrdup(optarg);
break;

case 'D': /* specify director name */
Expand Down Expand Up @@ -267,8 +267,8 @@ int main(int margc, char *margv[])

daemon_start_time = time(NULL);

my_config = InitSdConfig(configfile, M_ERROR_TERM);
ParseSdConfig(configfile, M_ERROR_TERM);
my_config = InitSdConfig(storagedaemon::configfile, M_ERROR_TERM);
ParseSdConfig(storagedaemon::configfile, M_ERROR_TERM);

if (DirectorName) {
foreach_res(director, R_DIRECTOR) {
Expand All @@ -278,7 +278,7 @@ int main(int margc, char *margv[])
}
if (!director) {
Emsg2(M_ERROR_TERM, 0, _("No Director resource named %s defined in %s. Cannot continue.\n"),
DirectorName, configfile);
DirectorName, storagedaemon::configfile);
}
}

Expand Down Expand Up @@ -355,8 +355,8 @@ static void TerminateBtape(int status)
DevFlushBackends();
#endif

if (configfile) {
free(configfile);
if (storagedaemon::configfile) {
free(storagedaemon::configfile);
}

if (my_config) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/stored/butil.cc
Expand Up @@ -147,7 +147,7 @@ static bool setup_to_access_device(DeviceControlRecord *dcr, JobControlRecord *j

if ((device = find_device_res(dev_name, readonly)) == NULL) {
Jmsg2(jcr, M_FATAL, 0, _("Cannot find device \"%s\" in config file %s.\n"),
dev_name, configfile);
dev_name, storagedaemon::configfile);
return false;
}

Expand Down Expand Up @@ -273,7 +273,7 @@ static DeviceResource *find_device_res(char *device_name, bool readonly)

if (!found) {
Pmsg2(0, _("Could not find device \"%s\" in config file %s.\n"), device_name,
configfile);
storagedaemon::configfile);
return NULL;
}

Expand Down
19 changes: 11 additions & 8 deletions core/src/stored/dir_cmd.cc
Expand Up @@ -229,7 +229,7 @@ static inline bool count_running_jobs()
}
endeach_jcr(jcr);

return (cnt >= me->MaxConcurrentJobs) ? false : true;
return (cnt >= storagedaemon::me->MaxConcurrentJobs) ? false : true;
}

/**
Expand Down Expand Up @@ -385,9 +385,11 @@ static bool die_cmd(JobControlRecord *jcr)
static bool SecureerasereqCmd(JobControlRecord *jcr) {
BareosSocket *dir = jcr->dir_bsock;

Dmsg1(220,"Secure Erase Cmd Request: %s\n", (me->secure_erase_cmdline ? me->secure_erase_cmdline : "*None*"));
Dmsg1(220,"Secure Erase Cmd Request: %s\n", (storagedaemon::me->secure_erase_cmdline
? storagedaemon::me->secure_erase_cmdline : "*None*"));

return dir->fsend(OKsecureerase, (me->secure_erase_cmdline ? me->secure_erase_cmdline : "*None*"));
return dir->fsend(OKsecureerase, (storagedaemon::me->secure_erase_cmdline
? storagedaemon::me->secure_erase_cmdline : "*None*"));
}

/**
Expand All @@ -414,14 +416,14 @@ static bool SetbandwidthCmd(JobControlRecord *jcr)
cjcr->max_bandwidth = bw;
if (cjcr->store_bsock) {
cjcr->store_bsock->SetBwlimit(bw);
if (me->allow_bw_bursting) {
if (storagedaemon::me->allow_bw_bursting) {
cjcr->store_bsock->SetBwlimitBursting();
}
}
FreeJcr(cjcr);
}
} else { /* No job requested, apply globally */
me->max_bandwidth_per_job = bw; /* Overwrite directive */
storagedaemon::me->max_bandwidth_per_job = bw; /* Overwrite directive */
}

return dir->fsend(OKBandwidth);
Expand Down Expand Up @@ -1296,7 +1298,8 @@ static inline bool GetBootstrapFile(JobControlRecord *jcr, BareosSocket *sock)
}
P(bsr_mutex);
bsr_uniq++;
Mmsg(fname, "%s/%s.%s.%d.bootstrap", me->working_directory, me->name(),
Mmsg(fname, "%s/%s.%s.%d.bootstrap", storagedaemon::me->working_directory,
storagedaemon::me->name(),
jcr->Job, bsr_uniq);
V(bsr_mutex);
Dmsg1(400, "bootstrap=%s\n", fname);
Expand Down Expand Up @@ -1594,7 +1597,7 @@ static bool ReplicateCmd(JobControlRecord *jcr)
BareosSocket *sd; /* storage daemon bsock */

sd = New(BareosSocketTCP);
if (me->nokeepalive) {
if (storagedaemon::me->nokeepalive) {
sd->ClearKeepalive();
}
Dmsg1(100, "ReplicateCmd: %s", dir->msg);
Expand All @@ -1610,7 +1613,7 @@ static bool ReplicateCmd(JobControlRecord *jcr)

Dmsg3(110, "Open storage: %s:%d ssl=%d\n", stored_addr, stored_port, enable_ssl);

sd->SetSourceAddress(me->SDsrc_addr);
sd->SetSourceAddress(storagedaemon::me->SDsrc_addr);

if (!jcr->max_bandwidth) {
if (jcr->director->max_bandwidth_per_job) {
Expand Down

0 comments on commit 56da487

Please sign in to comment.