X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Frecord.c;h=c1582aa5c2a4e895981ec67ab697d9f96b06321c;hb=3fe17b53281b5b18437a63036251e62bb6a5a414;hp=1fd96ca2dd9a3fb3fd4cbd866a884e5903998678;hpb=0f4da832fd082c208f3a13e4fadaeb7534e1273e;p=bacula%2Fbacula diff --git a/bacula/src/stored/record.c b/bacula/src/stored/record.c index 1fd96ca2dd..c1582aa5c2 100644 --- a/bacula/src/stored/record.c +++ b/bacula/src/stored/record.c @@ -1,24 +1,14 @@ -/* - * - * record.c -- tape record handling functions - * - * Kern Sibbald, April MMI - * added BB02 format October MMII - * - * Version $Id$ - * - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2001-2006 Free Software Foundation Europe e.V. + Copyright (C) 2001-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. This program is Free Software; you can redistribute it and/or modify it under the terms of version two of the GNU General Public - License as published by the Free Software Foundation plus additions - that are listed in the file LICENSE. + License as published by the Free Software Foundation and included + in the file LICENSE. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -30,11 +20,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Bacula® is a registered trademark of John Walker. + Bacula® is a registered trademark of Kern Sibbald. The licensor of Bacula is the Free Software Foundation Europe (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * + * record.c -- tape record handling functions + * + * Kern Sibbald, April MMI + * added BB02 format October MMII + * + * Version $Id$ + * + */ #include "bacula.h" @@ -116,6 +116,8 @@ const char *stream_to_ascii(char *buf, int stream, int fi) return "PROG-NAMES"; case STREAM_PROGRAM_DATA: return "PROG-DATA"; + case STREAM_PLUGIN_NAME: + return "PLUGIN-NAME"; case STREAM_MACOS_FORK_DATA: return "MACOS-RSRC"; case STREAM_HFSPLUS_ATTRIBUTES: @@ -184,6 +186,9 @@ const char *stream_to_ascii(char *buf, int stream, int fi) return "contENCRYPTED-WIN32-GZIP"; case -STREAM_ENCRYPTED_MACOS_FORK_DATA: return "contENCRYPTED-MACOS-RSRC"; + case -STREAM_PLUGIN_NAME: + return "contPLUGIN-NAME"; + default: sprintf(buf, "%d", stream); return buf; @@ -254,7 +259,7 @@ bool write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec) ASSERT(block->buf_len >= block->binbuf); Dmsg6(890, "write_record_to_block() FI=%s SessId=%d Strm=%s len=%d\n" -"rem=%d remainder=%d\n", + "rem=%d remainder=%d\n", FI_to_ascii(buf1, rec->FileIndex), rec->VolSessionId, stream_to_ascii(buf2, rec->Stream, rec->FileIndex), rec->data_len, remlen, rec->remainder); @@ -365,7 +370,7 @@ bool write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec) if (!sm_check_rtn(__FILE__, __LINE__, False)) { /* We damaged a buffer */ Dmsg6(0, "Damaged block FI=%s SessId=%d Strm=%s len=%d\n" -"rem=%d remainder=%d\n", + "rem=%d remainder=%d\n", FI_to_ascii(buf1, rec->FileIndex), rec->VolSessionId, stream_to_ascii(buf2, rec->Stream, rec->FileIndex), rec->data_len, remlen, rec->remainder); @@ -417,6 +422,10 @@ bool can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec) return true; } +uint64_t get_record_address(DEV_RECORD *rec) +{ + return ((uint64_t)rec->File)<<32 | rec->Block; +} /* * Read a Record from the block @@ -439,15 +448,14 @@ bool read_record_from_block(DCR *dcr, DEV_BLOCK *block, DEV_RECORD *rec) char buf1[100], buf2[100]; remlen = block->binbuf; - rec->Block = block->BlockNumber; - rec->File = ((DEVICE *)block->dev)->file; /* Clear state flags */ rec->state = 0; if (block->dev->is_tape()) { rec->state |= REC_ISTAPE; } - + rec->Block = ((DEVICE *)block->dev)->EndBlock; + rec->File = ((DEVICE *)block->dev)->EndFile; /* * Get the header. There is always a full header,