]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Enable disk seeking on restore.
authorKern Sibbald <kern@sibbald.com>
Sun, 3 Dec 2006 20:01:09 +0000 (20:01 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 3 Dec 2006 20:01:09 +0000 (20:01 +0000)
kes  Implement the SD 'Block Positioning = yes|no' directive. This
     allows the user to turn off block level seeking, but restores
     will be much slower.
kes  Change the word illegal to read invalid in a few places.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3738 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_dotcmds.c
bacula/src/dird/ua_output.c
bacula/src/dird/ua_status.c
bacula/src/filed/job.c
bacula/src/stored/btape.c
bacula/src/stored/dircmd.c
bacula/src/stored/match_bsr.c
bacula/src/stored/read_record.c
bacula/technotes-1.39

index 8e6bb272d9f1d1f24212e55e97921ac3e4e21bf4..c9f37be4338964bae52346d94afc2beabaa88797 100644 (file)
@@ -177,7 +177,7 @@ int do_a_command(UAContext *ua, const char *cmd)
       }
    }
    if (!found) {
-      bnet_fsend(ua->UA_sock, _("%s: is an illegal command.\n"), ua->argk[0]);
+      bnet_fsend(ua->UA_sock, _("%s: is an invalid command.\n"), ua->argk[0]);
    }
    return stat;
 }
@@ -613,7 +613,7 @@ static int setip_cmd(UAContext *ua, const char *cmd)
    CLIENT *client;
    char buf[1024];
    if (!ua->cons || !acl_access_ok(ua, Client_ACL, ua->cons->hdr.name)) {
-      bsendmsg(ua, _("Illegal command from this console.\n"));
+      bsendmsg(ua, _("Unauthorized command from this console.\n"));
       return 1;
    }
    LockRes();
@@ -659,7 +659,7 @@ static void do_en_disable_cmd(UAContext *ua, bool setting)
    }
 
    if (!acl_access_ok(ua, Job_ACL, job->hdr.name)) {
-      bsendmsg(ua, _("Illegal command from this console.\n"));
+      bsendmsg(ua, _("Unauthorized command from this console.\n"));
       return;
    }
    job->enabled = setting;
index 3d0d9bb53a92df71699c1944ba18a593950fb069..ec084e252f75164d695ad52405f1c3fe04df2f2c 100644 (file)
@@ -115,7 +115,7 @@ int do_a_dot_command(UAContext *ua, const char *cmd)
       }
    }
    if (!found) {
-      pm_strcat(ua->UA_sock->msg, _(": is an illegal command\n"));
+      pm_strcat(ua->UA_sock->msg, _(": is an invalid command\n"));
       ua->UA_sock->msglen = strlen(ua->UA_sock->msg);
       bnet_send(ua->UA_sock);
    }
index 2e2dcf61e0d6446fb6f2d932d5377a7d0c156b9f..231e64f0da9976d2206a2971e92e4747a0bb9daf 100644 (file)
@@ -428,7 +428,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist)
          if (j >= 0) {
             n = atoi(ua->argv[j]);
             if ((n < 0) || (n > 50)) {
-              bsendmsg(ua, _("Ignoring illegal value for days.\n"));
+              bsendmsg(ua, _("Ignoring invalid value for days. Max is 50.\n"));
               n = 1;
             }
          }
index fc1c2d889ad4d4b569520119e92719e55181ae01..fbc162814644bbd3e653d62bb895955fdba0594d 100644 (file)
@@ -462,7 +462,7 @@ static void list_scheduled_jobs(UAContext *ua)
    if (i >= 0) {
      days = atoi(ua->argv[i]);
      if ((days < 0) || (days > 50)) {
-       bsendmsg(ua, _("Ignoring illegal value for days.\n"));
+       bsendmsg(ua, _("Ignoring invalid value for days. Max is 50.\n"));
        days = 1;
      }
    }
index e7d52346557eb517a582f70a703f55f3800e934f..f6cb4a91a39397dae3c6a3bf45a32d890db3cbd8 100644 (file)
@@ -124,7 +124,7 @@ static char runscript[]   = "Run OnSuccess=%u OnFailure=%u AbortOnError=%u When=
 /* Responses sent to Director */
 static char errmsg[]      = "2999 Invalid command\n";
 static char no_auth[]     = "2998 No Authorization\n";
-static char illegal_cmd[] = "2997 Illegal command for a Director with Monitor directive enabled\n";
+static char invalid_cmd[] = "2997 Invalid command for a Director with Monitor directive enabled.\n";
 static char OKinc[]       = "2000 OK include\n";
 static char OKest[]       = "2000 OK estimate files=%u bytes=%s\n";
 static char OKlevel[]     = "2000 OK level\n";
@@ -223,8 +223,8 @@ void *handle_client_request(void *dirp)
                break;
             }
             if ((jcr->authenticated) && (!cmds[i].monitoraccess) && (jcr->director->monitor)) {
-               Dmsg1(100, "Command %s illegal.\n", cmds[i].cmd);
-               bnet_fsend(dir, illegal_cmd);
+               Dmsg1(100, "Command \"%s\" is invalid.\n", cmds[i].cmd);
+               bnet_fsend(dir, invalid_cmd);
                bnet_sig(dir, BNET_EOD);
                break;
             }
index bd5a265bff2c78d138c61f908a4f437fc94b984f..4c7a7c5bbc5058a23fa10edb3b698c7316eef79a 100644 (file)
@@ -2572,7 +2572,7 @@ do_tape_cmds()
             break;
          }
       if (!found) {
-         Pmsg1(0, _("\"%s\" is an illegal command\n"), cmd);
+         Pmsg1(0, _("\"%s\" is an invalid command\n"), cmd);
       }
    }
 }
index fb8312c12847c839d290e75fa232d4a5008bc052..8987fbfb1d6289520db9f075b9c4f13bfb2082b7 100644 (file)
@@ -62,7 +62,7 @@ extern bool init_done;
 /* Static variables */
 static char derrmsg[]     = "3900 Invalid command\n";
 static char OKsetdebug[]  = "3000 OK setdebug=%d\n";
-static char illegal_cmd[] = "3997 Illegal command for a Director with Monitor directive enabled\n";
+static char invalid_cmd[] = "3997 Invalid command for a Director with Monitor directive enabled.\n";
 
 /* Imported functions */
 extern void terminate_child();
@@ -212,8 +212,8 @@ void *handle_connection_request(void *arg)
       for (i=0; cmds[i].cmd; i++) {
         if (strncmp(cmds[i].cmd, bs->msg, strlen(cmds[i].cmd)) == 0) {
            if ((!cmds[i].monitoraccess) && (jcr->director->monitor)) {
-              Dmsg1(100, "Command %s illegal.\n", cmds[i].cmd);
-              bnet_fsend(bs, illegal_cmd);
+              Dmsg1(100, "Command \"%s\" is invalid.\n", cmds[i].cmd);
+              bnet_fsend(bs, invalid_cmd);
               bnet_sig(bs, BNET_EOD);
               break;
            }
index 4cf196230f4deb4812237c8c4e45a197854fd595..e613c3e7411515662e54afddc14326d9001deedf 100755 (executable)
@@ -191,13 +191,10 @@ BSR *find_next_bsr(BSR *root_bsr, DEVICE *dev)
 {
    BSR *bsr;
    BSR *found_bsr = NULL;
-   bool no_file_seek = !dev->is_tape();
-#ifdef FILE_SEEK
-   no_file_seek = false;
-#endif
 
+   /* Do tape/disk seeking only if CAP_POSITIONBLOCKS is on */
    if (!root_bsr || !root_bsr->use_positioning ||
-       !root_bsr->reposition || no_file_seek) {
+       !root_bsr->reposition || !dev->has_cap(CAP_POSITIONBLOCKS)) {
       Dmsg2(dbglevel, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition);
       return NULL;
    }
index ae512567e6ac686b0e2d01ca48ca9ec6586322ce..b2dc3113f12fd7bda1afefb7ddd38a15917b118f 100644 (file)
@@ -333,12 +333,10 @@ static bool try_repositioning(JCR *jcr, DEV_RECORD *rec, DCR *dcr)
        *   when find_next_bsr() is fixed not to return a bsr already
        *   completed.
        */
-#ifdef xxx
       if (dev->file > bsr->volfile->sfile ||             
          (dev->file == bsr->volfile->sfile && dev->block_num > bsr->volblock->sblock)) {
          return false;
       }
-#endif
       if (verbose) {
          Jmsg(jcr, M_INFO, 0, _("Reposition from (file:block) %u:%u to %u:%u\n"),
             dev->file, dev->block_num, bsr->volfile->sfile,
index 712f3d51c90da46faf4a48d3d2284960cf4d9ad2..8265b4e17420df71b49e134f0d8e4e502970aa61 100644 (file)
@@ -2,6 +2,11 @@
 
 General:
 03Dec06
+kes  Enable disk seeking on restore.
+kes  Implement the SD 'Block Positioning = yes|no' directive. This
+     allows the user to turn off block level seeking, but restores
+     will be much slower.
+kes  Change the word illegal to read invalid in a few places.
 kes  Fix Win32 build, which broke when I added parse_args_only in
      lib. I'm not sure I got the entry point right for msvc.
 kes  Turn off data encryption. It can be enabled by defining