Skip to content

Commit

Permalink
Fixup tree for rebuilding code tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent b8292a5 commit b71aa9c
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 79 deletions.
2 changes: 1 addition & 1 deletion src/console/console.c
Expand Up @@ -996,7 +996,7 @@ static bool select_director(const char *director, DIRRES **ret_dir, CONRES **ret
goto try_again;
}
delete UA_sock;
LockRes(config);
LockRes();
for (i=0; i<item; i++) {
dir = (DIRRES *)GetNextRes(R_DIRECTOR, (RES *)dir);
}
Expand Down
6 changes: 3 additions & 3 deletions src/dird/dird.c
Expand Up @@ -729,7 +729,7 @@ static bool check_resources()
char **def_svalue, **svalue; /* string value */
uint32_t *def_ivalue, *ivalue; /* integer value */
bool *def_bvalue, *bvalue; /* bool value */
uint64_t *def_lvalue, *lvalue; /* 64 bit values */
int64_t *def_lvalue, *lvalue; /* 64 bit values */
uint32_t offset;

Dmsg4(1400, "Job \"%s\", field \"%s\" bit=%d def=%d\n",
Expand Down Expand Up @@ -802,10 +802,10 @@ static bool check_resources()
/*
* Handle 64 bit integer fields
*/
def_lvalue = (uint64_t *)((char *)(job->jobdefs) + offset);
def_lvalue = (int64_t *)((char *)(job->jobdefs) + offset);
Dmsg5(400, "Job \"%s\", field \"%s\" def_lvalue=%" lld " item %d offset=%u\n",
job->name(), job_items[i].name, *def_lvalue, i, offset);
lvalue = (uint64_t *)((char *)job + offset);
lvalue = (int64_t *)((char *)job + offset);
*lvalue = *def_lvalue;
set_bit(i, job->hdr.item_present);
} else if (job_items[i].handler == store_bool) {
Expand Down
2 changes: 2 additions & 0 deletions src/dird/dird_conf.c
Expand Up @@ -145,6 +145,7 @@ static RES_ITEM dir_items[] = {
{ "verid", store_str, ITEM(res_dir.verid), 0, 0, NULL },
{ "optimizeforsize", store_bool, ITEM(res_dir.optimize_for_size), 0, ITEM_DEFAULT, "true" },
{ "optimizeforspeed", store_bool, ITEM(res_dir.optimize_for_speed), 0, ITEM_DEFAULT, "false" },
{ "nokeepalive", store_bool, ITEM(res_dir.nokeepalive), 0, ITEM_DEFAULT, "false" },
{ "keyencryptionkey", store_clearpassword, ITEM(res_dir.keyencrkey), 1, 0, NULL },
{ "ndmpsnooping", store_bool, ITEM(res_dir.ndmp_snooping), 0, 0, NULL },
{ "ndmploglevel", store_pint32, ITEM(res_dir.ndmp_loglevel), 0, ITEM_DEFAULT, "4" },
Expand Down Expand Up @@ -325,6 +326,7 @@ RES_ITEM job_items[] = {
{ "verifyjob", store_res, ITEM(res_job.verify_job), R_JOB, 0, NULL },
{ "jobtoverify", store_res, ITEM(res_job.verify_job), R_JOB, 0, NULL },
{ "jobdefs", store_res, ITEM(res_job.jobdefs), R_JOBDEFS, 0, NULL },
{ "catalog", store_res, ITEM(res_job.catalog), R_CATALOG, 0, NULL },
{ "run", store_alist_str, ITEM(res_job.run_cmds), 0, 0, NULL },
/* Root of where to restore files */
{ "where", store_dir, ITEM(res_job.RestoreWhere), 0, 0, NULL },
Expand Down
17 changes: 8 additions & 9 deletions src/dird/dird_conf.h
Expand Up @@ -265,13 +265,10 @@ class CLIENTRES {
uint32_t ndmp_loglevel; /* NDMP Protocol specific loglevel to use */
uint32_t ndmp_blocksize; /* NDMP Protocol specific blocksize to use */
uint32_t FDport; /* Where File daemon listens */
uint32_t MaxConcurrentJobs; /* Maximum concurrent jobs */
uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
uint64_t SoftQuota; /* Soft Quota permitted in bytes */
uint64_t HardQuota; /* Maximum permitted quota in bytes */
uint64_t GraceTime; /* Time remaining on gracetime */
uint64_t QuotaLimit; /* The total softquota supplied if over grace */
uint64_t max_bandwidth; /* Limit speed on this client */
utime_t SoftQuotaGracePeriod; /* Grace time for softquota */
utime_t FileRetention; /* file retention period in seconds */
utime_t JobRetention; /* job retention period in seconds */
Expand All @@ -280,6 +277,8 @@ class CLIENTRES {
char *username; /* Username to use for authentication if protocol supports it */
char *password;
CATRES *catalog; /* Catalog resource */
int32_t MaxConcurrentJobs; /* Maximum concurrent jobs */
int32_t NumConcurrentJobs; /* number of concurrent jobs running */
char *tls_ca_certfile; /* TLS CA Certificate File */
char *tls_ca_certdir; /* TLS CA Certificate Directory */
char *tls_crlfile; /* TLS CA Certificate Revocation List File */
Expand Down Expand Up @@ -335,8 +334,8 @@ class STORERES {
bool enabled; /* Set if device is enabled */
bool autochanger; /* Set if autochanger */
bool AllowCompress; /* Set if this Storage should allow jobs to enable compression */
uint64_t StorageId; /* Set from Storage DB record */
uint64_t max_bandwidth; /* Limit speed on this storage daemon for replication */
int64_t StorageId; /* Set from Storage DB record */
int64_t max_bandwidth; /* Limit speed on this storage daemon for replication */
utime_t heartbeat_interval; /* Interval to send heartbeats */
uint32_t drives; /* Number of drives in autochanger */
STORERES *paired_storage; /* Paired storage configuration item for protocols like NDMP */
Expand Down Expand Up @@ -427,9 +426,9 @@ class JOBRES {
utime_t MaxFullInterval; /* Maximum time interval between Fulls */
utime_t MaxDiffInterval; /* Maximum time interval between Diffs */
utime_t DuplicateJobProximity; /* Permitted time between duplicicates */
uint64_t spool_size; /* Size of spool file for this job */
uint32_t MaxConcurrentJobs; /* Maximum concurrent jobs */
uint32_t NumConcurrentJobs; /* number of concurrent jobs running */
int64_t spool_size; /* Size of spool file for this job */
int32_t MaxConcurrentJobs; /* Maximum concurrent jobs */
int32_t NumConcurrentJobs; /* number of concurrent jobs running */
bool allow_mixed_priority; /* Allow jobs with higher priority concurrently with this */

MSGSRES *messages; /* How and where to send messages */
Expand Down Expand Up @@ -474,7 +473,7 @@ class JOBRES {
bool IgnoreDuplicateJobChecking; /* Ignore Duplicate Job Checking */

alist *base; /* Base jobs */
uint64_t max_bandwidth; /* Speed limit on this job */
int64_t max_bandwidth; /* Speed limit on this job */

/* Methods */
char *name() const;
Expand Down
2 changes: 1 addition & 1 deletion src/dird/job.c
Expand Up @@ -1494,7 +1494,7 @@ void set_jcr_defaults(JCR *jcr, JOBRES *job)
jcr->res.catalog = job->client->catalog;
pm_strcpy(jcr->res.catalog_source, _("Client resource"));
} else {
jcr->res.catalog = (CATRES *)my_config->GetNextRes(R_CATALOG, NULL);
jcr->res.catalog = (CATRES *)GetNextRes(R_CATALOG, NULL);
pm_strcpy(jcr->res.catalog_source, _("Default catalog"));
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/dird/migrate.c
Expand Up @@ -918,7 +918,7 @@ static int getJob_to_migrate(JCR *jcr)
char *p;
idpkt ids, mid, jids;
db_int64_ctx ctx;
uint64_t pool_bytes;
int64_t pool_bytes;
time_t ttime;
struct tm tm;
char dt[MAX_TIME_LENGTH];
Expand Down Expand Up @@ -998,7 +998,7 @@ static int getJob_to_migrate(JCR *jcr)
pool_bytes = ctx.value;
Dmsg2(dbglevel, "highbytes=%lld pool=%lld\n", jcr->res.rpool->MigrationHighBytes,
pool_bytes);
if (pool_bytes < jcr->res.rpool->MigrationHighBytes) {
if (pool_bytes < (int64_t)jcr->res.rpool->MigrationHighBytes) {
Jmsg(jcr, M_INFO, 0, _("No Volumes found to %s.\n"), jcr->get_ActionName());
goto ok_out;
}
Expand Down Expand Up @@ -1054,7 +1054,7 @@ static int getJob_to_migrate(JCR *jcr)
Dmsg2(dbglevel, "lowbytes=%s poolafter=%s\n",
edit_int64_with_commas(jcr->res.rpool->MigrationLowBytes, ed1),
edit_int64_with_commas(pool_bytes, ed2));
if (pool_bytes <= jcr->res.rpool->MigrationLowBytes) {
if (pool_bytes <= (int64_t)jcr->res.rpool->MigrationLowBytes) {
Dmsg0(dbglevel, "We should be done.\n");
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/dird/ua_cmds.c
Expand Up @@ -738,7 +738,7 @@ static int create_cmd(UAContext *ua, const char *cmd)
}

static inline int setbwlimit_filed(UAContext *ua, CLIENTRES *client,
uint64_t limit, char *Job)
int64_t limit, char *Job)
{
/*
* Connect to File daemon
Expand Down Expand Up @@ -775,7 +775,7 @@ static inline int setbwlimit_filed(UAContext *ua, CLIENTRES *client,
}

static inline int setbwlimit_stored(UAContext *ua, STORERES *store,
uint64_t limit, char *Job)
int64_t limit, char *Job)
{
/*
* Check the storage daemon protocol.
Expand Down
9 changes: 4 additions & 5 deletions src/dird/ua_select.c
Expand Up @@ -1217,14 +1217,13 @@ alist *select_jobs(UAContext *ua, const char *reason)
ua->error_msg(_("Unauthorized command from this console.\n"));
goto bail_out;
}
}

if (insert_selected_jobid(selected_jobids, jcr->JobId)) {
cnt++;
}

if (insert_selected_jobid(selected_jobids, jcr->JobId)) {
cnt++;
}
free_jcr(jcr);
jcr = NULL;
}
}
}

Expand Down
12 changes: 3 additions & 9 deletions src/filed/backup.c
Expand Up @@ -1264,21 +1264,15 @@ bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_stream)
#endif

Dmsg1(300, "encode_and_send_attrs fname=%s\n", ff_pkt->fname);
/**
* Find what data stream we will use, then encode the attributes
*/
/** Find what data stream we will use, then encode the attributes */
if ((data_stream = select_data_stream(ff_pkt, me->compatible)) == STREAM_NONE) {
/*
* This should not happen
*/
/* This should not happen */
Jmsg0(jcr, M_FATAL, 0, _("Invalid file flags, no supported data stream type.\n"));
return false;
}
encode_stat(attribs, &ff_pkt->statp, sizeof(ff_pkt->statp), ff_pkt->LinkFI, data_stream);

/**
* Now possibly extend the attributes
*/
/** Now possibly extend the attributes */
if (IS_FT_OBJECT(ff_pkt->type)) {
attr_stream = STREAM_RESTORE_OBJECT;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/filed/dir_cmd.c
Expand Up @@ -700,7 +700,7 @@ static bool setauthorization_cmd(JCR *jcr)
static bool setbandwidth_cmd(JCR *jcr)
{
BSOCK *dir = jcr->dir_bsock;
uint64_t bw = 0;
int64_t bw = 0;
JCR *cjcr;
char Job[MAX_NAME_LENGTH];

Expand Down
1 change: 1 addition & 0 deletions src/filed/filed.c
Expand Up @@ -51,6 +51,7 @@ static bool foreground = false;
static workq_t dir_workq; /* queue of work from Director */
static alist *sock_fds;
static pthread_t tcp_server_tid;
static CONFIG *config;

static void usage()
{
Expand Down
3 changes: 3 additions & 0 deletions src/filed/filed_conf.c
Expand Up @@ -118,8 +118,10 @@ static RES_ITEM cli_items[] = {
{ "tlscertificaterevocationlist", store_dir, ITEM(res_client.tls_crlfile), 0, 0, NULL },
{ "tlscertificate", store_dir, ITEM(res_client.tls_certfile), 0, 0, NULL },
{ "tlskey", store_dir, ITEM(res_client.tls_keyfile), 0, 0, NULL },
{ "tlsallowedcn", store_alist_dir, ITEM(res_client.tls_allowed_cns), 0, 0, NULL },
{ "verid", store_str, ITEM(res_client.verid), 0, 0, NULL },
{ "compatible", store_bool, ITEM(res_client.compatible), 0, ITEM_DEFAULT, "true" },
{ "nokeepalive", store_bool, ITEM(res_client.nokeepalive), 0, ITEM_DEFAULT, "false" },
{ "maximumbandwidthperjob", store_speed, ITEM(res_client.max_bandwidth_per_job), 0, 0, NULL },
{ "allowbandwidthbursting", store_bool, ITEM(res_client.allow_bw_bursting), 0, ITEM_DEFAULT, "false" },
{ "allowedscriptdir", store_alist_dir, ITEM(res_client.allowed_script_dirs), 0, 0, NULL },
Expand Down Expand Up @@ -437,6 +439,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
res->res_client.pki_signers = res_all.res_client.pki_signers;
res->res_client.pki_recipients = res_all.res_client.pki_recipients;
res->res_client.messages = res_all.res_client.messages;
res->res_client.tls_allowed_cns = res_all.res_client.tls_allowed_cns;
res->res_client.allowed_script_dirs = res_all.res_client.allowed_script_dirs;
res->res_client.allowed_job_cmds = res_all.res_client.allowed_job_cmds;
break;
Expand Down
5 changes: 3 additions & 2 deletions src/filed/verify.c
Expand Up @@ -337,11 +337,12 @@ int digest_file(JCR *jcr, FF_PKT *ff_pkt, DIGEST *digest)
static int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr)
{
char buf[DEFAULT_NETWORK_BUFFER_SIZE];
uint64_t n;
uint64_t bufsiz = (uint64_t)sizeof(buf);
int64_t n;
int64_t bufsiz = (int64_t)sizeof(buf);
FF_PKT *ff_pkt = (FF_PKT *)jcr->ff;
uint64_t fileAddr = 0; /* file address */


Dmsg0(50, "=== read_digest\n");
while ((n=bread(bfd, buf, bufsiz)) > 0) {
/* Check for sparse blocks */
Expand Down
31 changes: 4 additions & 27 deletions src/lib/edit.c
Expand Up @@ -255,36 +255,13 @@ bool duration_to_utime(char *str, utime_t *value)
double val, total = 0.0;
char mod_str[20];
char num_str[50];

/*
* The "n" = mins and months appears before minutes so that m maps to months.
*/
static const char *mod[] = {
"n",
"seconds",
"months",
"minutes",
"mins",
"hours",
"days",
"weeks",
"quarters",
"years",
(char *)NULL
};
static const int32_t mult[] = {
60,
1,
3600 * 24 * 30,
60,
60,
3600,
3600 * 24,
3600 * 24 * 7,
3600 * 24 * 91,
3600 * 24 * 365,
0
};
static const char *mod[] = {"n", "seconds", "months", "minutes", "mins",
"hours", "days", "weeks", "quarters", "years", NULL};
static const int32_t mult[] = {60, 1, 60*60*24*30, 60, 60,
3600, 3600*24, 3600*24*7, 3600*24*91, 3600*24*365};

while (*str) {
if (!get_modifier(str, num_str, sizeof(num_str), mod_str, sizeof(mod_str))) {
Expand Down
8 changes: 4 additions & 4 deletions src/stored/dev.h
Expand Up @@ -182,9 +182,9 @@ struct VOLUME_CAT_INFO {
uint32_t VolCatMaxFiles; /* Maximum files to write to volume */
uint64_t VolCatMaxBytes; /* Max bytes to write to volume */
uint64_t VolCatCapacityBytes; /* capacity estimate */
uint64_t VolMediaId; /* MediaId */
btime_t VolReadTime; /* time spent reading */
btime_t VolWriteTime; /* time spent writing this Volume */
int64_t VolMediaId; /* MediaId */
utime_t VolFirstWritten; /* Time of first write */
utime_t VolLastWritten; /* Time of last write */
bool InChanger; /* Set if vol in current magazine */
Expand Down Expand Up @@ -535,9 +535,9 @@ class DCR {
uint32_t StartFile; /* Start write file */
uint32_t StartBlock; /* Start write block */
uint32_t EndBlock; /* Ending block written */
uint64_t VolMediaId; /* MediaId */
uint64_t job_spool_size; /* Current job spool size */
uint64_t max_job_spool_size; /* Max job spool size */
int64_t VolMediaId; /* MediaId */
int64_t job_spool_size; /* Current job spool size */
int64_t max_job_spool_size; /* Max job spool size */
char VolumeName[MAX_NAME_LENGTH]; /* Volume name */
char pool_name[MAX_NAME_LENGTH]; /* Pool name */
char pool_type[MAX_NAME_LENGTH]; /* Pool type */
Expand Down
2 changes: 1 addition & 1 deletion src/stored/dir_cmd.c
Expand Up @@ -387,7 +387,7 @@ static bool die_cmd(JCR *jcr)
static bool setbandwidth_cmd(JCR *jcr)
{
BSOCK *dir = jcr->dir_bsock;
uint64_t bw = 0;
int64_t bw = 0;
JCR *cjcr;
char Job[MAX_NAME_LENGTH];

Expand Down
8 changes: 4 additions & 4 deletions src/stored/spool.c
Expand Up @@ -43,10 +43,10 @@ struct spool_stats_t {
uint32_t attr_jobs;
uint32_t total_data_jobs; /* total jobs to have spooled data */
uint32_t total_attr_jobs;
uint64_t max_data_size; /* max data size */
uint64_t max_attr_size;
uint64_t data_size; /* current data size (all jobs running) */
uint64_t attr_size;
int64_t max_data_size; /* max data size */
int64_t max_attr_size;
int64_t data_size; /* current data size (all jobs running) */
int64_t attr_size;
};

static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
Expand Down
3 changes: 3 additions & 0 deletions src/stored/stored_conf.c
Expand Up @@ -102,6 +102,7 @@ static RES_ITEM store_items[] = {
{ "clientconnectwait", store_time, ITEM(res_store.client_wait), 0, ITEM_DEFAULT, "1800" /* 30 minutes */ },
{ "verid", store_str, ITEM(res_store.verid), 0, 0, NULL },
{ "compatible", store_bool, ITEM(res_store.compatible), 0, ITEM_DEFAULT, "true" },
{ "nokeepalive", store_bool, ITEM(res_store.nokeepalive), 0, ITEM_DEFAULT, "false" },
{ "maximumbandwidthperjob", store_speed, ITEM(res_store.max_bandwidth_per_job), 0, 0, NULL },
{ "allowbandwidthbursting", store_bool, ITEM(res_store.allow_bw_bursting), 0, ITEM_DEFAULT, "false" },
{ "ndmpenable", store_bool, ITEM(res_store.ndmp_enable), 0, 0, NULL },
Expand Down Expand Up @@ -183,6 +184,8 @@ static RES_ITEM dev_items[] = {
{ "requiresmount", store_bit, ITEM(res_dev.cap_bits), CAP_REQMOUNT, ITEM_DEFAULT, "off" },
{ "offlineonunmount", store_bit, ITEM(res_dev.cap_bits), CAP_OFFLINEUNMOUNT, ITEM_DEFAULT, "off" },
{ "blockchecksum", store_bit, ITEM(res_dev.cap_bits), CAP_BLOCKCHECKSUM, ITEM_DEFAULT, "on" },
{ "ioerrorateom", store_bit, ITEM(res_dev.cap_bits), CAP_IOERRATEOM, ITEM_DEFAULT, "off" },
{ "ibmlintape", store_bit, ITEM(res_dev.cap_bits), CAP_IBMLINTAPE, ITEM_DEFAULT, "off" },
{ "autoselect", store_bool, ITEM(res_dev.autoselect), 0, ITEM_DEFAULT, "true" },
{ "changerdevice", store_strname, ITEM(res_dev.changer_name), 0, 0, NULL },
{ "changercommand", store_strname, ITEM(res_dev.changer_command), 0, 0, NULL },
Expand Down
15 changes: 8 additions & 7 deletions src/stored/stored_conf.h
Expand Up @@ -167,13 +167,14 @@ class DEVRES {
uint32_t autodeflate; /* Perform auto deflation in this IO direction */
uint32_t autoinflate; /* Perform auto inflation in this IO direction */
utime_t vol_poll_interval; /* Interval between polling volume during mount */
uint64_t max_volume_files; /* Max files to put on one volume */
uint64_t max_volume_size; /* Max bytes to put on one volume */
uint64_t max_file_size; /* Max file size in bytes */
uint64_t volume_capacity; /* Advisory capacity */
uint64_t max_spool_size; /* Max spool size for all jobs */
uint64_t max_job_spool_size; /* Max spool size for any single job */

int64_t max_volume_files; /* Max files to put on one volume */
int64_t max_volume_size; /* Max bytes to put on one volume */
int64_t max_file_size; /* Max file size in bytes */
int64_t volume_capacity; /* Advisory capacity */
int64_t max_spool_size; /* Max spool size for all jobs */
int64_t max_job_spool_size; /* Max spool size for any single job */

int64_t max_part_size; /* Max part size */
char *mount_point; /* Mount point for require mount devices */
char *mount_command; /* Mount command */
char *unmount_command; /* Unmount command */
Expand Down
3 changes: 3 additions & 0 deletions src/win32/compat/include/mingwconfig.h
Expand Up @@ -407,6 +407,9 @@
/* Define to 1 if you have the `getaddrinfo' function. */
#define HAVE_GETADDRINFO 1

/* Define to 1 if you have the `__builtin_va_copy' function. */
#define HAVE___BUILTIN_VA_COPY 1

/* Define to 1 if readline support should be enabled */
#define HAVE_READLINE 1

Expand Down

0 comments on commit b71aa9c

Please sign in to comment.