From: Kern Sibbald Date: Sun, 2 Nov 2008 11:00:29 +0000 (+0000) Subject: Use jcr stored in bsock rather than searching in getmsg.c. X-Git-Tag: Release-3.0.0~652 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=78066fb9cddec90fafdc42ba62a46244b9621740;p=bacula%2Fbacula Use jcr stored in bsock rather than searching in getmsg.c. This results in about a 5% speed improvement with four concurrent jobs. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7964 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/getmsg.c b/bacula/src/dird/getmsg.c index ec1c16cf00..4cfd87d765 100644 --- a/bacula/src/dird/getmsg.c +++ b/bacula/src/dird/getmsg.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2000-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -129,7 +129,7 @@ int bget_dirmsg(BSOCK *bs) char Job[MAX_NAME_LENGTH]; char MsgType[20]; int type, level; - JCR *jcr; + JCR *jcr = bs->jcr(); char *msg; for (;;) { @@ -169,7 +169,7 @@ int bget_dirmsg(BSOCK *bs) bs->fsend("btime %s\n", edit_uint64(get_current_btime(),ed1)); break; default: - Emsg1(M_WARNING, 0, _("bget_dirmsg: unknown bnet signal %d\n"), bs->msglen); + Jmsg1(jcr, M_WARNING, 0, _("bget_dirmsg: unknown bnet signal %d\n"), bs->msglen); return n; } continue; @@ -187,21 +187,13 @@ int bget_dirmsg(BSOCK *bs) * Try to fulfill it. */ if (sscanf(bs->msg, "%020s Job=%127s ", MsgType, Job) != 2) { - Emsg1(M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); + Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); continue; } - if (strcmp(Job, "*System*") == 0) { - jcr = NULL; /* No jcr */ - } else if (!(jcr=get_jcr_by_full_name(Job))) { - Emsg1(M_ERROR, 0, _("Job not found: %s\n"), bs->msg); - continue; - } - Dmsg1(900, "Getmsg got jcr 0x%x\n", jcr); /* Skip past "Jmsg Job=nnn" */ if (!(msg=find_msg_start(bs->msg))) { - Emsg1(M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); - free_jcr(jcr); + Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); continue; } @@ -212,8 +204,7 @@ int bget_dirmsg(BSOCK *bs) if (bs->msg[0] == 'J') { /* Job message */ if (sscanf(bs->msg, "Jmsg Job=%127s type=%d level=%d", Job, &type, &level) != 3) { - Emsg1(M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); - free_jcr(jcr); + Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); continue; } Dmsg1(900, "Got msg: %s\n", bs->msg); @@ -226,7 +217,6 @@ int bget_dirmsg(BSOCK *bs) } Dmsg1(900, "Dispatch msg: %s", msg); dispatch_message(jcr, type, level, msg); - free_jcr(jcr); continue; } /* @@ -236,32 +226,26 @@ int bget_dirmsg(BSOCK *bs) if (bs->msg[0] == 'C') { /* Catalog request */ Dmsg2(900, "Catalog req jcr 0x%x: %s", jcr, bs->msg); catalog_request(jcr, bs); - Dmsg1(900, "Calling freejcr 0x%x\n", jcr); - free_jcr(jcr); continue; } if (bs->msg[0] == 'U') { /* SD sending attributes */ Dmsg2(900, "Catalog upd jcr 0x%x: %s", jcr, bs->msg); catalog_update(jcr, bs); - Dmsg1(900, "Calling freejcr 0x%x\n", jcr); - free_jcr(jcr); continue; } if (bs->msg[0] == 'M') { /* Mount request */ Dmsg1(900, "Mount req: %s", bs->msg); mount_request(jcr, bs, msg); - free_jcr(jcr); continue; } if (bs->msg[0] == 'S') { /* Status change */ int JobStatus; char Job[MAX_NAME_LENGTH]; if (sscanf(bs->msg, Job_status, &Job, &JobStatus) == 2) { - set_jcr_sd_job_status(jcr,JobStatus); /* current status */ + set_jcr_sd_job_status(jcr, JobStatus); /* current status */ } else { - Emsg1(M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); + Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg); } - free_jcr(jcr); continue; } #ifdef needed diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c index 47e5962447..56ab82efa5 100644 --- a/bacula/src/dird/msgchan.c +++ b/bacula/src/dird/msgchan.c @@ -123,7 +123,7 @@ bool connect_to_storage_daemon(JCR *jcr, int retry_interval, * Here we ask the SD to send us the info for a * particular device resource. */ -#ifdef needed +#ifdef xxx bool update_device_res(JCR *jcr, DEVICE *dev) { POOL_MEM device_name; diff --git a/bacula/src/version.h b/bacula/src/version.h index 99b1cb2880..ac7612dc90 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.5.17" -#define BDATE "29 October 2008" -#define LSMDATE "29Oct08" +#define VERSION "2.5.18" +#define BDATE "02 November 2008" +#define LSMDATE "02Nov08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index e5acfaad41..3dffb4fccf 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -10,6 +10,12 @@ filepattern (restore with regex in bsr) mixed priorities General: +02Nov08 +kes Use jcr stored in bsock rather than searching in getmsg.c. + This results in about a 5% speed improvement with four + concurrent jobs. +kes Implement win32_chmod that uses wide characters, if possible, + to get and set the file attributes. 29Oct08 kes Apply pane freezing during updates patch from Riccardo Ghetta. kes Rework next_vol and autoprune a bit due to failure in