From: Kern Sibbald Date: Wed, 23 Feb 2011 11:18:51 +0000 (+0100) Subject: replace set_Jobxxx by setJobxxx X-Git-Tag: Release-7.0.0~1109 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=96d566602a7b08dbfb3970aac9031f940b9f7f8e;p=bacula%2Fbacula replace set_Jobxxx by setJobxxx --- diff --git a/bacula/src/dird/dir_plugins.c b/bacula/src/dird/dir_plugins.c index ea6685b147..2c289a3be7 100644 --- a/bacula/src/dird/dir_plugins.c +++ b/bacula/src/dird/dir_plugins.c @@ -371,7 +371,7 @@ static bRC baculaSetValue(bpContext *ctx, bwVariable var, void *value) for (int i=0; ok && joblevels[i].level_name; i++) { if (strcasecmp(strval, joblevels[i].level_name) == 0) { if (joblevels[i].job_type == jcr->getJobType()) { - jcr->set_JobLevel(joblevels[i].level); + jcr->setJobLevel(joblevels[i].level); jcr->jr.JobLevel = jcr->getJobLevel(); ok = false; } diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index bdf6b7c6b8..ff14469a85 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -246,13 +246,13 @@ void get_level_since_time(JCR *jcr, char *since, int since_len) Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found in catalog. Doing FULL backup.\n")); bsnprintf(since, since_len, _(" (upgraded from %s)"), level_to_str(jcr->getJobLevel())); - jcr->set_JobLevel(jcr->jr.JobLevel = L_FULL); + jcr->setJobLevel(jcr->jr.JobLevel = L_FULL); } else if (do_diff) { /* No recent diff job found, so upgrade this one to Diff */ Jmsg(jcr, M_INFO, 0, _("No prior or suitable Differential backup found in catalog. Doing Differential backup.\n")); bsnprintf(since, since_len, _(" (upgraded from %s)"), level_to_str(jcr->getJobLevel())); - jcr->set_JobLevel(jcr->jr.JobLevel = L_DIFFERENTIAL); + jcr->setJobLevel(jcr->jr.JobLevel = L_DIFFERENTIAL); } else { if (jcr->job->rerun_failed_levels) { if (db_find_failed_job_since(jcr, jcr->db, &jcr->jr, jcr->stime, JobLevel)) { @@ -260,7 +260,7 @@ void get_level_since_time(JCR *jcr, char *since, int since_len) level_to_str(JobLevel)); bsnprintf(since, since_len, _(" (upgraded from %s)"), level_to_str(jcr->getJobLevel())); - jcr->set_JobLevel(jcr->jr.JobLevel = JobLevel); + jcr->setJobLevel(jcr->jr.JobLevel = JobLevel); jcr->jr.JobId = jcr->JobId; break; } diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 626f6bbfae..056c4cb522 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -1114,15 +1114,15 @@ void get_job_storage(USTORE *store, JOB *job, RUN *run) void set_jcr_defaults(JCR *jcr, JOB *job) { jcr->job = job; - jcr->set_JobType(job->JobType); + jcr->setJobType(job->JobType); jcr->JobStatus = JS_Created; switch (jcr->getJobType()) { case JT_ADMIN: - jcr->set_JobLevel(L_NONE); + jcr->setJobLevel(L_NONE); break; default: - jcr->set_JobLevel(job->JobLevel); + jcr->setJobLevel(job->JobLevel); break; } @@ -1182,17 +1182,17 @@ void set_jcr_defaults(JCR *jcr, JOB *job) if (jcr->getJobLevel() == 0) { switch (jcr->getJobType()) { case JT_VERIFY: - jcr->set_JobLevel(L_VERIFY_CATALOG); + jcr->setJobLevel(L_VERIFY_CATALOG); break; case JT_BACKUP: - jcr->set_JobLevel(L_INCREMENTAL); + jcr->setJobLevel(L_INCREMENTAL); break; case JT_RESTORE: case JT_ADMIN: - jcr->set_JobLevel(L_NONE); + jcr->setJobLevel(L_NONE); break; default: - jcr->set_JobLevel(L_FULL); + jcr->setJobLevel(L_FULL); break; } } diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c index a94235a234..3aa1d6ce59 100644 --- a/bacula/src/dird/jobq.c +++ b/bacula/src/dird/jobq.c @@ -675,7 +675,7 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je) set_jcr_defaults(njcr, jcr->job); njcr->reschedule_count = jcr->reschedule_count; njcr->sched_time = jcr->sched_time; - njcr->set_JobLevel(jcr->getJobLevel()); + njcr->setJobLevel(jcr->getJobLevel()); njcr->pool = jcr->pool; njcr->run_pool_override = jcr->run_pool_override; njcr->full_pool = jcr->full_pool; diff --git a/bacula/src/dird/pythondir.c b/bacula/src/dird/pythondir.c index e3e8fb7d3e..20a78ab29f 100644 --- a/bacula/src/dird/pythondir.c +++ b/bacula/src/dird/pythondir.c @@ -294,7 +294,7 @@ int job_setattr(PyObject *self, char *attrname, PyObject *value) for (i=0; joblevels[i].level_name; i++) { if (strcmp(strval, joblevels[i].level_name) == 0) { if (joblevels[i].job_type == jcr->getJobType()) { - jcr->set_JobLevel(joblevels[i].level); + jcr->setJobLevel(joblevels[i].level); jcr->jr.JobLevel = jcr->getJobLevel(); return 0; } diff --git a/bacula/src/dird/scheduler.c b/bacula/src/dird/scheduler.c index 6bcc3daf80..95c80befe6 100644 --- a/bacula/src/dird/scheduler.c +++ b/bacula/src/dird/scheduler.c @@ -200,7 +200,7 @@ again: ASSERT(job); set_jcr_defaults(jcr, job); if (run->level) { - jcr->set_JobLevel(run->level); /* override run level */ + jcr->setJobLevel(run->level); /* override run level */ } if (run->pool) { jcr->pool = run->pool; /* override pool */ diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index fcecd16431..bd4dd79455 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1190,7 +1190,7 @@ static int estimate_cmd(UAContext *ua, const char *cmd) JCR *jcr = ua->jcr; int accurate=-1; - jcr->set_JobLevel(L_FULL); + jcr->setJobLevel(L_FULL); for (int i=1; iargc; i++) { if (strcasecmp(ua->argk[i], NT_("client")) == 0 || strcasecmp(ua->argk[i], NT_("fd")) == 0) { @@ -1303,7 +1303,7 @@ static int estimate_cmd(UAContext *ua, const char *cmd) } jcr->job = job; - jcr->set_JobType(JT_BACKUP); + jcr->setJobType(JT_BACKUP); init_jcr_job_record(jcr); if (!get_or_create_client_record(jcr)) { diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 06470ab685..95036f5eb1 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -700,19 +700,19 @@ static void select_job_level(UAContext *ua, JCR *jcr) // jcr->JobLevel = L_BASE; // break; case 0: - jcr->set_JobLevel(L_FULL); + jcr->setJobLevel(L_FULL); break; case 1: - jcr->set_JobLevel(L_INCREMENTAL); + jcr->setJobLevel(L_INCREMENTAL); break; case 2: - jcr->set_JobLevel(L_DIFFERENTIAL); + jcr->setJobLevel(L_DIFFERENTIAL); break; case 3: - jcr->set_JobLevel(L_SINCE); + jcr->setJobLevel(L_SINCE); break; case 4: - jcr->set_JobLevel(L_VIRTUAL_FULL); + jcr->setJobLevel(L_VIRTUAL_FULL); break; default: break; @@ -726,19 +726,19 @@ static void select_job_level(UAContext *ua, JCR *jcr) add_prompt(ua, _("Verify Volume Data (not yet implemented)")); switch (do_prompt(ua, "", _("Select level"), NULL, 0)) { case 0: - jcr->set_JobLevel(L_VERIFY_INIT); + jcr->setJobLevel(L_VERIFY_INIT); break; case 1: - jcr->set_JobLevel(L_VERIFY_CATALOG); + jcr->setJobLevel(L_VERIFY_CATALOG); break; case 2: - jcr->set_JobLevel(L_VERIFY_VOLUME_TO_CATALOG); + jcr->setJobLevel(L_VERIFY_VOLUME_TO_CATALOG); break; case 3: - jcr->set_JobLevel(L_VERIFY_DISK_TO_CATALOG); + jcr->setJobLevel(L_VERIFY_DISK_TO_CATALOG); break; case 4: - jcr->set_JobLevel(L_VERIFY_DATA); + jcr->setJobLevel(L_VERIFY_DATA); break; default: break; @@ -789,7 +789,7 @@ static bool display_job_parameters(UAContext *ua, JCR *jcr, JOB *job, const char bstrutime(dt, sizeof(dt), jcr->sched_time), jcr->JobPriority); } - jcr->set_JobLevel(L_FULL); + jcr->setJobLevel(L_FULL); break; case JT_BACKUP: case JT_VERIFY: @@ -924,7 +924,7 @@ static bool display_job_parameters(UAContext *ua, JCR *jcr, JOB *job, const char jcr->RestoreJobId = ua->int64_val; } } - jcr->set_JobLevel(L_FULL); /* default level */ + jcr->setJobLevel(L_FULL); /* default level */ Dmsg1(800, "JobId to restore=%d\n", jcr->RestoreJobId); if (jcr->RestoreJobId == 0) { /* RegexWhere is take before RestoreWhere */ @@ -1081,7 +1081,7 @@ static bool display_job_parameters(UAContext *ua, JCR *jcr, JOB *job, const char case JT_COPY: case JT_MIGRATE: char *prt_type; - jcr->set_JobLevel(L_FULL); /* default level */ + jcr->setJobLevel(L_FULL); /* default level */ if (ua->api) { ua->signal(BNET_RUN_CMD); if (jcr->getJobType() == JT_COPY) { diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index 2ada78ad19..5db0551d19 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -1079,7 +1079,7 @@ bool get_level_from_name(JCR *jcr, const char *level_name) bool found = false; for (int i=0; joblevels[i].level_name; i++) { if (strcasecmp(level_name, joblevels[i].level_name) == 0) { - jcr->set_JobLevel(joblevels[i].level); + jcr->setJobLevel(joblevels[i].level); found = true; break; } diff --git a/bacula/src/dird/ua_server.c b/bacula/src/dird/ua_server.c index 0be9b9db04..03c8c5b3fa 100644 --- a/bacula/src/dird/ua_server.c +++ b/bacula/src/dird/ua_server.c @@ -103,8 +103,8 @@ JCR *new_control_jcr(const char *base_name, int job_type) jcr->sd_auth_key = bstrdup("dummy"); /* dummy Storage daemon key */ create_unique_job_name(jcr, base_name); jcr->sched_time = jcr->start_time; - jcr->set_JobType(job_type); - jcr->set_JobLevel(L_NONE); + jcr->setJobType(job_type); + jcr->setJobLevel(L_NONE); set_jcr_job_status(jcr, JS_Running); jcr->JobId = 0; return jcr; diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index b1483f8c28..26f03e51aa 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -496,7 +496,7 @@ static void prt_runtime(UAContext *ua, sched_pkt *sp) db_close_database(jcr, jcr->db); } jcr->db = ua->db; /* restore ua db to jcr */ - jcr->set_JobType(orig_jobtype); + jcr->setJobType(orig_jobtype); } /* diff --git a/bacula/src/dird/vbackup.c b/bacula/src/dird/vbackup.c index c579f9989f..5745e8702c 100644 --- a/bacula/src/dird/vbackup.c +++ b/bacula/src/dird/vbackup.c @@ -284,7 +284,7 @@ void vbackup_cleanup(JCR *jcr, int TermCode) memset(&mr, 0, sizeof(mr)); memset(&cr, 0, sizeof(cr)); - jcr->set_JobLevel(L_FULL); /* we want this to appear as a Full backup */ + jcr->setJobLevel(L_FULL); /* we want this to appear as a Full backup */ jcr->jr.JobLevel = L_FULL; /* we want this to appear as a Full backup */ jcr->JobFiles = jcr->SDJobFiles; jcr->JobBytes = jcr->SDJobBytes; diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 86641b0a71..b829866316 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1525,16 +1525,16 @@ static int level_cmd(JCR *jcr) } /* Base backup requested? */ if (strcmp(level, "base") == 0) { - jcr->set_JobLevel(L_BASE); + jcr->setJobLevel(L_BASE); /* Full backup requested? */ } else if (strcmp(level, "full") == 0) { - jcr->set_JobLevel(L_FULL); + jcr->setJobLevel(L_FULL); } else if (strstr(level, "differential")) { - jcr->set_JobLevel(L_DIFFERENTIAL); + jcr->setJobLevel(L_DIFFERENTIAL); free_memory(level); return 1; } else if (strstr(level, "incremental")) { - jcr->set_JobLevel(L_INCREMENTAL); + jcr->setJobLevel(L_INCREMENTAL); free_memory(level); return 1; /* @@ -1546,7 +1546,7 @@ static int level_cmd(JCR *jcr) utime_t since_time, adj; btime_t his_time, bt_start, rt=0, bt_adj=0; if (jcr->getJobLevel() == L_NONE) { - jcr->set_JobLevel(L_SINCE); /* if no other job level set, do it now */ + jcr->setJobLevel(L_SINCE); /* if no other job level set, do it now */ } if (sscanf(dir->msg, "level = since_utime %s mtime_only=%d", buf, &mtime_only) != 2) { @@ -1784,7 +1784,7 @@ static int backup_cmd(JCR *jcr) } set_jcr_job_status(jcr, JS_Blocked); - jcr->set_JobType(JT_BACKUP); + jcr->setJobType(JT_BACKUP); Dmsg1(100, "begin backup ff=%p\n", jcr->ff); if (sd == NULL) { @@ -1949,22 +1949,22 @@ static int verify_cmd(JCR *jcr) BSOCK *sd = jcr->store_bsock; char level[100]; - jcr->set_JobType(JT_VERIFY); + jcr->setJobType(JT_VERIFY); if (sscanf(dir->msg, verifycmd, level) != 1) { dir->fsend(_("2994 Bad verify command: %s\n"), dir->msg); return 0; } if (strcasecmp(level, "init") == 0) { - jcr->set_JobLevel(L_VERIFY_INIT); + jcr->setJobLevel(L_VERIFY_INIT); } else if (strcasecmp(level, "catalog") == 0){ - jcr->set_JobLevel(L_VERIFY_CATALOG); + jcr->setJobLevel(L_VERIFY_CATALOG); } else if (strcasecmp(level, "volume") == 0){ - jcr->set_JobLevel(L_VERIFY_VOLUME_TO_CATALOG); + jcr->setJobLevel(L_VERIFY_VOLUME_TO_CATALOG); } else if (strcasecmp(level, "data") == 0){ - jcr->set_JobLevel(L_VERIFY_DATA); + jcr->setJobLevel(L_VERIFY_DATA); } else if (strcasecmp(level, "disk_to_catalog") == 0) { - jcr->set_JobLevel(L_VERIFY_DISK_TO_CATALOG); + jcr->setJobLevel(L_VERIFY_DISK_TO_CATALOG); } else { dir->fsend(_("2994 Bad verify level: %s\n"), dir->msg); return 0; @@ -2109,7 +2109,7 @@ static int restore_cmd(JCR *jcr) dir->fsend(OKrestore); Dmsg1(110, "filed>dird: %s", dir->msg); - jcr->set_JobType(JT_RESTORE); + jcr->setJobType(JT_RESTORE); set_jcr_job_status(jcr, JS_Blocked); diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 6e13b48de9..47575156f3 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -192,9 +192,7 @@ public: bool is_JobLevel(int32_t JobLevel) { return JobLevel == m_JobLevel; }; bool is_JobType(int32_t JobType) { return JobType == m_JobType; }; bool is_JobStatus(int32_t aJobStatus) { return aJobStatus == JobStatus; }; - void set_JobLevel(int32_t JobLevel) { m_JobLevel = JobLevel; }; void setJobLevel(int32_t JobLevel) { m_JobLevel = JobLevel; }; - void set_JobType(int32_t JobType) { m_JobType = JobType; }; void setJobType(int32_t JobType) { m_JobType = JobType; }; int32_t getJobType() const { return m_JobType; }; int32_t getJobLevel() const { return m_JobLevel; }; diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index 1a695813da..0e11790807 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -539,7 +539,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec) jr.PoolId = pr.PoolId; mjcr->start_time = jr.StartTime; - mjcr->set_JobLevel(jr.JobLevel); + mjcr->setJobLevel(jr.JobLevel); mjcr->client_name = get_pool_memory(PM_FNAME); pm_strcpy(mjcr->client_name, label.ClientName); @@ -1310,8 +1310,8 @@ static JCR *create_jcr(JOB_DBR *jr, DEV_RECORD *rec, uint32_t JobId) * the JobId and the ClientId. */ jobjcr = new_jcr(sizeof(JCR), bscan_free_jcr); - jobjcr->set_JobType(jr->JobType); - jobjcr->set_JobLevel(jr->JobLevel); + jobjcr->setJobType(jr->JobType); + jobjcr->setJobLevel(jr->JobLevel); jobjcr->JobStatus = jr->JobStatus; bstrncpy(jobjcr->Job, jr->Job, sizeof(jobjcr->Job)); jobjcr->JobId = JobId; /* this is JobId on tape */ diff --git a/bacula/src/stored/butil.c b/bacula/src/stored/butil.c index 1cfde180aa..8d1f9c33a8 100644 --- a/bacula/src/stored/butil.c +++ b/bacula/src/stored/butil.c @@ -92,8 +92,8 @@ JCR *setup_jcr(const char *name, char *dev_name, BSR *bsr, jcr->NumReadVolumes = 0; jcr->NumWriteVolumes = 0; jcr->JobId = 0; - jcr->set_JobType(JT_CONSOLE); - jcr->set_JobLevel(L_FULL); + jcr->setJobType(JT_CONSOLE); + jcr->setJobLevel(L_FULL); jcr->JobStatus = JS_Terminated; jcr->where = bstrdup(""); jcr->job_name = get_pool_memory(PM_FNAME); diff --git a/bacula/src/stored/fd_cmds.c b/bacula/src/stored/fd_cmds.c index 110a6bf659..f642cf9d4d 100644 --- a/bacula/src/stored/fd_cmds.c +++ b/bacula/src/stored/fd_cmds.c @@ -198,7 +198,7 @@ static bool append_data_cmd(JCR *jcr) Dmsg1(120, "Append data: %s", fd->msg); if (jcr->session_opened) { Dmsg1(110, "msg); - jcr->set_JobType(JT_BACKUP); + jcr->setJobType(JT_BACKUP); if (do_append_data(jcr)) { return true; } else { @@ -331,7 +331,7 @@ static bool read_open_session(JCR *jcr) } jcr->session_opened = true; - jcr->set_JobType(JT_RESTORE); + jcr->setJobType(JT_RESTORE); /* Send "Ticket" to File Daemon */ fd->fsend(OK_open, jcr->VolSessionId); diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c index aab7afbd12..8ab4c2ed73 100644 --- a/bacula/src/stored/job.c +++ b/bacula/src/stored/job.c @@ -129,8 +129,8 @@ bool job_cmd(JCR *jcr) unbash_spaces(fileset_name); jcr->fileset_name = get_pool_memory(PM_NAME); pm_strcpy(jcr->fileset_name, fileset_name); - jcr->set_JobType(JobType); - jcr->set_JobLevel(level); + jcr->setJobType(JobType); + jcr->setJobLevel(level); jcr->no_attributes = no_attributes; jcr->spool_attributes = spool_attributes; jcr->spool_data = spool_data; diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index e9f4d15101..779507b996 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -523,7 +523,7 @@ void *device_initialization(void *arg) pthread_detach(pthread_self()); jcr = new_jcr(sizeof(JCR), stored_free_jcr); - jcr->set_JobType(JT_SYSTEM); + jcr->setJobType(JT_SYSTEM); /* Initialize FD start condition variable */ int errstat = pthread_cond_init(&jcr->job_start_wait, NULL); if (errstat != 0) { diff --git a/bacula/src/tools/bbatch.c b/bacula/src/tools/bbatch.c index 61f57ae632..00244f0d6c 100644 --- a/bacula/src/tools/bbatch.c +++ b/bacula/src/tools/bbatch.c @@ -131,10 +131,10 @@ int main (int argc, char *argv[]) restore_list=bstrdup(optarg); break; case 'B': - disable_batch = true; + disable_batch = true; break; case 'b': - disable_batch = false; + disable_batch = false; break; case 'd': /* debug level */ if (*optarg == 't') { @@ -231,8 +231,8 @@ int main (int argc, char *argv[]) bjcr->NumReadVolumes = 0; bjcr->NumWriteVolumes = 0; bjcr->JobId = getpid(); - bjcr->set_JobType(JT_CONSOLE); - bjcr->set_JobLevel(L_FULL); + bjcr->setJobType(JT_CONSOLE); + bjcr->setJobLevel(L_FULL); bjcr->JobStatus = JS_Running; bjcr->where = bstrdup(files[i]); bjcr->job_name = get_pool_memory(PM_FNAME); diff --git a/bacula/src/tools/bvfs_test.c b/bacula/src/tools/bvfs_test.c index 2cfbd13192..545591c09e 100644 --- a/bacula/src/tools/bvfs_test.c +++ b/bacula/src/tools/bvfs_test.c @@ -204,8 +204,8 @@ int main (int argc, char *argv[]) } JCR *bjcr = new_jcr(sizeof(JCR), NULL); bjcr->JobId = getpid(); - bjcr->set_JobType(JT_CONSOLE); - bjcr->set_JobLevel(L_FULL); + bjcr->setJobType(JT_CONSOLE); + bjcr->setJobLevel(L_FULL); bjcr->JobStatus = JS_Running; bjcr->client_name = get_pool_memory(PM_FNAME); pm_strcpy(bjcr->client_name, "Dummy.Client.Name");