From: Kern Sibbald Date: Wed, 30 Jul 2008 12:53:47 +0000 (+0000) Subject: kes Raise some restore debug levels. X-Git-Tag: Release-3.0.0~1104 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=42867b26d894413176e71e518841400da7581217;p=bacula%2Fbacula kes Raise some restore debug levels. kes Replace off_t by boffset_t where ever I found it. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7450 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 31ec1c9967..26dddc0fe1 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -505,7 +505,7 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level) do_read = true; } - Dmsg1(100, "do_read=%d\n", do_read); + Dmsg1(400, "do_read=%d\n", do_read); if (do_read) { btimer_t *tid; diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 7631ae8004..461d79b9e5 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -255,7 +255,7 @@ void do_restore(JCR *jcr) Jmsg1(jcr, M_FATAL, 0, _("Record header scan error: %s\n"), sd->msg); goto bail_out; } - Dmsg4(30, "Got hdr: Files=%d FilInx=%d Stream=%d, %s.\n", + Dmsg4(130, "Got hdr: Files=%d FilInx=%d Stream=%d, %s.\n", jcr->JobFiles, file_index, rctx.stream, stream_to_ascii(rctx.stream)); /* * Now we expect the Stream Data */ @@ -268,7 +268,7 @@ void do_restore(JCR *jcr) sd->msglen, rctx.size); goto bail_out; } - Dmsg3(30, "Got stream: %s len=%d extract=%d\n", stream_to_ascii(rctx.stream), + Dmsg3(130, "Got stream: %s len=%d extract=%d\n", stream_to_ascii(rctx.stream), sd->msglen, extract); /* If we change streams, close and reset alternate data streams */ @@ -314,7 +314,7 @@ void do_restore(JCR *jcr) free_signature(rctx); free_session(rctx); jcr->ff->flags = 0; - Dmsg0(30, "Stop extracting.\n"); + Dmsg0(130, "Stop extracting.\n"); } else if (is_bopen(&rctx.bfd)) { Jmsg0(jcr, M_ERROR, 0, _("Logic error: output file should not be open\n")); bclose(&rctx.bfd); @@ -334,7 +334,7 @@ void do_restore(JCR *jcr) if (file_index != attr->file_index) { Jmsg(jcr, M_FATAL, 0, _("Record header file index %ld not equal record index %ld\n"), file_index, attr->file_index); - Dmsg0(100, "File index error\n"); + Dmsg0(200, "File index error\n"); goto bail_out; } @@ -364,7 +364,7 @@ void do_restore(JCR *jcr) } else { stat = create_file(jcr, attr, &rctx.bfd, jcr->replace); } - Dmsg2(30, "Outfile=%s create_file stat=%d\n", attr->ofname, stat); + Dmsg2(130, "Outfile=%s create_file stat=%d\n", attr->ofname, stat); switch (stat) { case CF_ERROR: case CF_SKIP: @@ -566,7 +566,7 @@ void do_restore(JCR *jcr) } rctx.fork_size = rsrc_len; - Dmsg0(30, "Restoring resource fork\n"); + Dmsg0(130, "Restoring resource fork\n"); } if (extract_data(jcr, &rctx.forkbfd, sd->msg, sd->msglen, &rctx.fork_addr, rctx.fork_flags, @@ -583,7 +583,7 @@ void do_restore(JCR *jcr) case STREAM_HFSPLUS_ATTRIBUTES: #ifdef HAVE_DARWIN_OS - Dmsg0(30, "Restoring Finder Info\n"); + Dmsg0(130, "Restoring Finder Info\n"); jcr->ff->flags |= FO_HFSPLUS; if (sd->msglen != 32) { Jmsg(jcr, M_ERROR, 0, _(" Invalid length of Finder Info (got %d, not 32)\n"), sd->msglen); @@ -657,7 +657,7 @@ void do_restore(JCR *jcr) default: /* If extracting, wierd stream (not 1 or 2), close output file anyway */ if (extract) { - Dmsg1(30, "Found wierd stream %d\n", rctx.stream); + Dmsg1(130, "Found wierd stream %d\n", rctx.stream); if (rctx.size > 0 && !is_bopen(&rctx.bfd)) { Jmsg0(jcr, M_ERROR, 0, _("Logic error: output file should be open\n")); } @@ -960,7 +960,7 @@ bool decompress_data(JCR *jcr, char **data, uint32_t *length) * be used in Bacula. */ compress_len = jcr->compress_buf_size; - Dmsg2(100, "Comp_len=%d msglen=%d\n", compress_len, *length); + Dmsg2(200, "Comp_len=%d msglen=%d\n", compress_len, *length); if ((stat=uncompress((Byte *)jcr->compress_buf, &compress_len, (const Byte *)*data, (uLong)*length)) != Z_OK) { Qmsg(jcr, M_ERROR, 0, _("Uncompression error on file %s. ERR=%s\n"), @@ -969,7 +969,7 @@ bool decompress_data(JCR *jcr, char **data, uint32_t *length) } *data = jcr->compress_buf; *length = compress_len; - Dmsg2(100, "Write uncompressed %d bytes, total before write=%s\n", compress_len, edit_uint64(jcr->JobBytes, ec1)); + Dmsg2(200, "Write uncompressed %d bytes, total before write=%s\n", compress_len, edit_uint64(jcr->JobBytes, ec1)); return true; #else Qmsg(jcr, M_ERROR, 0, _("GZIP data stream found, but GZIP not configured!\n")); @@ -1059,7 +1059,7 @@ int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, return 0; } - Dmsg2(100, "decrypted len=%d encrypted len=%d\n", decrypted_len, wsize); + Dmsg2(200, "decrypted len=%d encrypted len=%d\n", decrypted_len, wsize); cipher_ctx->buf_len += decrypted_len; wbuf = cipher_ctx->buf; @@ -1080,7 +1080,7 @@ int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, wsize = cipher_ctx->packet_len - CRYPTO_LEN_SIZE; wbuf = &wbuf[CRYPTO_LEN_SIZE]; /* Skip the block length header */ cipher_ctx->buf_len -= cipher_ctx->packet_len; - Dmsg2(30, "Encryption writing full block, %u bytes, remaining %u bytes in buffer\n", wsize, cipher_ctx->buf_len); + Dmsg2(130, "Encryption writing full block, %u bytes, remaining %u bytes in buffer\n", wsize, cipher_ctx->buf_len); } if (flags & FO_SPARSE) { @@ -1100,13 +1100,13 @@ int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, } jcr->JobBytes += wsize; *addr += wsize; - Dmsg2(30, "Write %u bytes, JobBytes=%s\n", wsize, edit_uint64(jcr->JobBytes, ec1)); + Dmsg2(130, "Write %u bytes, JobBytes=%s\n", wsize, edit_uint64(jcr->JobBytes, ec1)); /* Clean up crypto buffers */ if (flags & FO_ENCRYPT) { /* Move any remaining data to start of buffer */ if (cipher_ctx->buf_len > 0) { - Dmsg1(30, "Moving %u buffered bytes to start of buffer\n", cipher_ctx->buf_len); + Dmsg1(130, "Moving %u buffered bytes to start of buffer\n", cipher_ctx->buf_len); memmove(cipher_ctx->buf, &cipher_ctx->buf[cipher_ctx->packet_len], cipher_ctx->buf_len); } @@ -1143,7 +1143,7 @@ again: cipher_ctx->buf_len, decrypted_len, jcr->last_fname); } - Dmsg2(30, "Flush decrypt len=%d buf_len=%d\n", decrypted_len, cipher_ctx->buf_len); + Dmsg2(130, "Flush decrypt len=%d buf_len=%d\n", decrypted_len, cipher_ctx->buf_len); /* If nothing new was decrypted, and our output buffer is empty, return */ if (decrypted_len == 0 && cipher_ctx->buf_len == 0) { return true; @@ -1156,7 +1156,7 @@ again: wsize = cipher_ctx->packet_len - CRYPTO_LEN_SIZE; wbuf = &cipher_ctx->buf[CRYPTO_LEN_SIZE]; /* Decrypted, possibly decompressed output here. */ cipher_ctx->buf_len -= cipher_ctx->packet_len; - Dmsg2(30, "Encryption writing full block, %u bytes, remaining %u bytes in buffer\n", wsize, cipher_ctx->buf_len); + Dmsg2(130, "Encryption writing full block, %u bytes, remaining %u bytes in buffer\n", wsize, cipher_ctx->buf_len); if (flags & FO_SPARSE) { if (!sparse_data(jcr, bfd, addr, &wbuf, &wsize)) { @@ -1170,16 +1170,16 @@ again: } } - Dmsg0(30, "Call store_data\n"); + Dmsg0(130, "Call store_data\n"); if (!store_data(jcr, bfd, wbuf, wsize, (flags & FO_WIN32DECOMP) != 0)) { return false; } jcr->JobBytes += wsize; - Dmsg2(30, "Flush write %u bytes, JobBytes=%s\n", wsize, edit_uint64(jcr->JobBytes, ec1)); + Dmsg2(130, "Flush write %u bytes, JobBytes=%s\n", wsize, edit_uint64(jcr->JobBytes, ec1)); /* Move any remaining data to start of buffer */ if (cipher_ctx->buf_len > 0) { - Dmsg1(30, "Moving %u buffered bytes to start of buffer\n", cipher_ctx->buf_len); + Dmsg1(130, "Moving %u buffered bytes to start of buffer\n", cipher_ctx->buf_len); memmove(cipher_ctx->buf, &cipher_ctx->buf[cipher_ctx->packet_len], cipher_ctx->buf_len); } diff --git a/bacula/src/findlib/bfile.c b/bacula/src/findlib/bfile.c index 4d40871dfe..7fa74bac61 100644 --- a/bacula/src/findlib/bfile.c +++ b/bacula/src/findlib/bfile.c @@ -956,7 +956,7 @@ boffset_t blseek(BFILE *bfd, boffset_t offset, int whence) if (bfd->cmd_plugin && plugin_bwrite) { return plugin_blseek(bfd->jcr, offset, whence); } - pos = (boffset_t)lseek(bfd->fid, (off_t)offset, whence); + pos = (boffset_t)lseek(bfd->fid, offset, whence); bfd->berrno = errno; return pos; } diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index 54b123d8aa..4a512c4e99 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -204,12 +204,11 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) switch(attr->type) { case FT_REGE: case FT_REG: - Dmsg1(100, "Create file %s\n", attr->ofname); + Dmsg1(100, "Create=%s\n", attr->ofname); mode = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY; /* O_NOFOLLOW; */ if (IS_CTG(attr->statp.st_mode)) { mode |= O_CTG; /* set contiguous bit if needed */ } - Dmsg1(50, "Create file: %s\n", attr->ofname); if (is_bopen(bfd)) { Qmsg1(jcr, M_ERROR, 0, _("bpkt already open fid=%d\n"), bfd->fid); bclose(bfd); @@ -221,6 +220,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) be.set_errno(bfd->berrno); Qmsg2(jcr, M_ERROR, 0, _("Could not create %s: ERR=%s\n"), attr->ofname, be.bstrerror()); + Dmsg2(100,"Could not create %s: ERR=%s\n", attr->ofname, be.bstrerror()); return CF_ERROR; } return CF_EXTRACT; diff --git a/bacula/src/lib/jcr.c b/bacula/src/lib/jcr.c index c31ff6f11f..057df53f50 100644 --- a/bacula/src/lib/jcr.c +++ b/bacula/src/lib/jcr.c @@ -144,7 +144,7 @@ bool read_last_jobs_list(int fd, uint64_t addr) uint32_t num; Dmsg1(100, "read_last_jobs seek to %d\n", (int)addr); - if (addr == 0 || lseek(fd, (off_t)addr, SEEK_SET) < 0) { + if (addr == 0 || lseek(fd, (boffset_t)addr, SEEK_SET) < 0) { return false; } if (read(fd, &num, sizeof(num)) != sizeof(num)) { @@ -183,7 +183,7 @@ uint64_t write_last_jobs_list(int fd, uint64_t addr) uint32_t num; Dmsg1(100, "write_last_jobs seek to %d\n", (int)addr); - if (lseek(fd, (off_t)addr, SEEK_SET) < 0) { + if (lseek(fd, (boffset_t)addr, SEEK_SET) < 0) { return 0; } if (last_jobs) { diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index a9a54c514b..fce3719f6a 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -1972,7 +1972,7 @@ boffset_t DEVICE::lseek(DCR *dcr, boffset_t offset, int whence) #if defined(HAVE_WIN32) return ::_lseeki64(m_fd, (__int64)offset, whence); #else - return ::lseek(m_fd, (off_t)offset, whence); + return ::lseek(m_fd, offset, whence); #endif } return -1; diff --git a/bacula/src/stored/dvd.c b/bacula/src/stored/dvd.c index d96d497c4a..0496359b4a 100644 --- a/bacula/src/stored/dvd.c +++ b/bacula/src/stored/dvd.c @@ -486,7 +486,7 @@ boffset_t lseek_dvd(DCR *dcr, boffset_t offset, int whence) break; case SEEK_CUR: Dmsg1(400, "lseek_dvd SEEK_CUR to %s\n", edit_int64(offset, ed1)); - if ((pos = lseek(dev->fd(), (off_t)0, SEEK_CUR)) < 0) { + if ((pos = lseek(dev->fd(), 0, SEEK_CUR)) < 0) { Dmsg0(400, "Seek error.\n"); return pos; } @@ -518,7 +518,7 @@ boffset_t lseek_dvd(DCR *dcr, boffset_t offset, int whence) * right part number, simply seek */ if (dev->is_part_spooled() && dev->part > dev->num_dvd_parts) { - if ((pos = lseek(dev->fd(), (off_t)0, SEEK_END)) < 0) { + if ((pos = lseek(dev->fd(), 0, SEEK_END)) < 0) { return pos; } else { Dmsg1(400, "lseek_dvd SEEK_END returns %s\n", diff --git a/bacula/src/stored/spool.c b/bacula/src/stored/spool.c index 6dbc0a5569..01f6e2323b 100644 --- a/bacula/src/stored/spool.c +++ b/bacula/src/stored/spool.c @@ -511,7 +511,7 @@ static bool write_spool_header(DCR *dcr) #if defined(HAVE_WIN32) boffset_t pos = _lseeki64(dcr->spool_fd, (__int64)0, SEEK_CUR); #else - boffset_t pos = lseek(dcr->spool_fd, (off_t)0, SEEK_CUR); + boffset_t pos = lseek(dcr->spool_fd, 0, SEEK_CUR); #endif if (ftruncate(dcr->spool_fd, pos - stat) != 0) { berrno be; @@ -553,7 +553,7 @@ static bool write_spool_data(DCR *dcr) #if defined(HAVE_WIN32) boffset_t pos = _lseeki64(dcr->spool_fd, (__int64)0, SEEK_CUR); #else - boffset_t pos = lseek(dcr->spool_fd, (off_t)0, SEEK_CUR); + boffset_t pos = lseek(dcr->spool_fd, 0, SEEK_CUR); #endif if (ftruncate(dcr->spool_fd, pos - stat - sizeof(spool_hdr)) != 0) { berrno be; @@ -622,7 +622,7 @@ static void update_attr_spool_size(ssize_t size) bool commit_attribute_spool(JCR *jcr) { - off_t size; + boffset_t size; char ec1[30]; char tbuf[100]; diff --git a/bacula/src/stored/vtape.c b/bacula/src/stored/vtape.c index 492a844100..99e9fdd135 100644 --- a/bacula/src/stored/vtape.c +++ b/bacula/src/stored/vtape.c @@ -268,7 +268,7 @@ int vtape::tape_op(struct mtop *mt_com) current_file++; } } - off_t l; + boffset_t l; while (::read(fd, &l, sizeof(l)) > 0) { if (l) { lseek(fd, l, SEEK_CUR); @@ -527,8 +527,8 @@ int vtape::weof() cur_FM = lseek(fd, 0, SEEK_CUR); // current position /* update previous next_FM */ - lseek(fd, last_FM + sizeof(uint32_t)+sizeof(off_t), SEEK_SET); - ::write(fd, &cur_FM, sizeof(off_t)); + lseek(fd, last_FM + sizeof(uint32_t)+sizeof(boffset_t), SEEK_SET); + ::write(fd, &cur_FM, sizeof(boffset_t)); lseek(fd, cur_FM, SEEK_SET); next_FM = 0; @@ -643,7 +643,7 @@ int vtape::fsr(int count) ASSERT(fd >= 0); int i,nb, ret=0; - off_t where=0; + boffset_t where=0; uint32_t s; Dmsg4(dbglevel, "fsr %i:%i EOF=%i c=%i\n", current_file,current_block,atEOF,count); @@ -707,8 +707,8 @@ int vtape::bsr(int count) int last_f=0; int last_b=0; - off_t last=-1, last2=-1; - off_t orig = lseek(fd, 0, SEEK_CUR); + boffset_t last=-1, last2=-1; + boffset_t orig = lseek(fd, 0, SEEK_CUR); int orig_f = current_file; int orig_b = current_block; @@ -780,7 +780,7 @@ int vtape::bsr(int count) Dmsg2(dbglevel, "bsr %i:%i\n", current_file, current_block); errno=0; atEOT = atEOF = atEOD = false; - atBOT = (lseek(fd, 0, SEEK_CUR) - (sizeof(uint32_t)+2*sizeof(off_t))) == 0; + atBOT = (lseek(fd, 0, SEEK_CUR) - (sizeof(uint32_t)+2*sizeof(boffset_t))) == 0; if (orig_b == -1) { current_block = orig_b; diff --git a/bacula/src/stored/vtape.h b/bacula/src/stored/vtape.h index da788d94e1..146083f875 100644 --- a/bacula/src/stored/vtape.h +++ b/bacula/src/stored/vtape.h @@ -61,12 +61,12 @@ class vtape { private: int fd; /* Our file descriptor */ - off_t file_block; /* size */ - off_t max_block; + boffset_t file_block; /* size */ + boffset_t max_block; - off_t last_FM; /* last file mark (last file) */ - off_t next_FM; /* next file mark (next file) */ - off_t cur_FM; /* current file mark */ + boffset_t last_FM; /* last file mark (last file) */ + boffset_t next_FM; /* next file mark (next file) */ + boffset_t cur_FM; /* current file mark */ bool atEOF; /* End of file */ bool atEOT; /* End of media */ diff --git a/bacula/src/version.h b/bacula/src/version.h index b7ee249d04..95f056365b 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.5.2" -#define BDATE "28 July 2008" -#define LSMDATE "28Jul08" +#define BDATE "30 July 2008" +#define LSMDATE "30Jul08" #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 d7c3fccc19..7e32f6672c 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -32,6 +32,9 @@ separator in console (!$%&'()*+,-/:;<>?[]^`{|}~) General: +30Jul08 +kes Raise some restore debug levels. +kes Replace off_t by boffset_t where ever I found it. 28Jul08 kes Define a machine dependent ioctl request type for use with vtape_ioctl().