From cbbdd8b55ea5b7e108b42023cc8b32e592fbdf77 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 1 May 2004 10:35:56 +0000 Subject: [PATCH] New tape block rounding code git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1335 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/count-lines | 3 ++- bacula/src/stored/block.c | 9 ++++++--- bacula/src/version.h | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bacula/src/count-lines b/bacula/src/count-lines index cd70669b77..d1383c93a2 100755 --- a/bacula/src/count-lines +++ b/bacula/src/count-lines @@ -2,7 +2,8 @@ rm -f 1 touch 1 for i in . console gnome-console cats dird filed filed/win32 \ - win32 win32/compat findlib lib wx-console stored tools; do + win32 win32/compat findlib lib wx-console stored tools \ + win32/wx-console win32/console win32/baculafd; do ls -1 $i/*.c $i/*.cpp $i/*.h $i/*.in 2>/dev/null >>1 done cat 1 | $HOME/bin/lines diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index b2b20d7630..47c48ca5f1 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -427,12 +427,15 @@ int write_block_to_dev(DCR *dcr, DEV_BLOCK *block) /* Adjust write size to min/max for tapes only */ if (dev->state & ST_TAPE) { - if (wlen < dev->min_block_size) { - wlen = ((dev->min_block_size + TAPE_BSIZE - 1) / TAPE_BSIZE) * TAPE_BSIZE; - } /* check for fixed block size */ if (dev->min_block_size == dev->max_block_size) { wlen = block->buf_len; /* fixed block size already rounded */ + /* Check for min block size */ + } else if (wlen < dev->min_block_size) { + wlen = ((dev->min_block_size + TAPE_BSIZE - 1) / TAPE_BSIZE) * TAPE_BSIZE; + /* Ensure size is rounded */ + } else { + wlen = ((wlen + TAPE_BSIZE - 1) / TAPE_BSIZE) * TAPE_BSIZE; } } if (wlen-blen > 0) { diff --git a/bacula/src/version.h b/bacula/src/version.h index 74f16583e8..0996e32887 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -2,8 +2,8 @@ #undef VERSION #define VERSION "1.34.3" #define VSTRING "1" -#define BDATE "30 Apr 2004" -#define LSMDATE "30Apr04" +#define BDATE "01 May 2004" +#define LSMDATE "01May04" /* Debug flags */ #undef DEBUG -- 2.39.5