Skip to content

Commit

Permalink
Adds support for different blocksizes.
Browse files Browse the repository at this point in the history
Min- and maxblocksize are now a property of the
pool and are promoted to tapes in that pool.

Therefore, the media and pool database tables were
adapted to hold min and maxblocksize.

In order to be able to read the tape label always,
the label is always read and written with the
DEFAULT_BLOCK_SIZE = 63k/64512 bytes

For backward compatibility, the blocksize
DEFAULT_BLOCK_SIZE is used if the blocksize
for the medium is zero in the database table.

The device blocksizes are set to the values
of the mounted volume after it was mounted, so
all blocks being written after the label block
are written with the blocksizes configured in the
medium/pool.

Moving a tape from one pool to another through
the scratch pool mechanism is supported,
as then the pool's properties are promoted
to the medium.

This new feature makes it possible to move from
one blocksize to a new one during normal operation
while being able to restore the old backups at any
time.

For disaster recovery (DR) using bscan etc. you need to
set the blocksize used during write of the tape for
restore.

Fixes #267: make blocksize a property of the pool
  • Loading branch information
pstorz authored and Marco van Wieringen committed Feb 25, 2014
1 parent dc89f66 commit 860aaeb
Show file tree
Hide file tree
Showing 30 changed files with 366 additions and 91 deletions.
4 changes: 4 additions & 0 deletions src/cats/cats.h
Expand Up @@ -247,6 +247,8 @@ struct POOL_DBR {
DBId_t ScratchPoolId; /* ScratchPool source when media is needed */
char PoolType[MAX_NAME_LENGTH];
char LabelFormat[MAX_NAME_LENGTH];
uint32_t MinBlocksize; /* Minimum Block Size */
uint32_t MaxBlocksize; /* Maximum Block Size */
/* Extra stuff not in DB */
faddr_t rec_addr;
};
Expand Down Expand Up @@ -330,6 +332,8 @@ class MEDIA_DBR {
uint32_t EndFile; /* Last file on volume */
uint32_t EndBlock; /* Last block on volume */
uint32_t RecycleCount; /* Number of times recycled */
uint32_t MinBlocksize; /* Minimum Block Size */
uint32_t MaxBlocksize; /* Maximum Block Size */
char VolStatus[20]; /* Volume status */
DBId_t DeviceId; /* Device where Vol last written */
DBId_t LocationId; /* Where Volume is -- user defined */
Expand Down
17 changes: 10 additions & 7 deletions src/cats/sql_create.c
Expand Up @@ -198,8 +198,8 @@ bool db_create_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pr)
"INSERT INTO Pool (Name,NumVols,MaxVols,UseOnce,UseCatalog,"
"AcceptAnyVolume,AutoPrune,Recycle,VolRetention,VolUseDuration,"
"MaxVolJobs,MaxVolFiles,MaxVolBytes,PoolType,LabelType,LabelFormat,"
"RecyclePoolId,ScratchPoolId,ActionOnPurge) "
"VALUES ('%s',%u,%u,%d,%d,%d,%d,%d,%s,%s,%u,%u,%s,'%s',%d,'%s',%s,%s,%d)",
"RecyclePoolId,ScratchPoolId,ActionOnPurge,MinBlocksize,MaxBlocksize) "
"VALUES ('%s',%u,%u,%d,%d,%d,%d,%d,%s,%s,%u,%u,%s,'%s',%d,'%s',%s,%s,%d,%d,%d)",
esc_name,
pr->NumVols, pr->MaxVols,
pr->UseOnce, pr->UseCatalog,
Expand All @@ -212,8 +212,9 @@ bool db_create_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pr)
pr->PoolType, pr->LabelType, esc_lf,
edit_int64(pr->RecyclePoolId,ed4),
edit_int64(pr->ScratchPoolId,ed5),
pr->ActionOnPurge
);
pr->ActionOnPurge,
pr->MinBlocksize,
pr->MaxBlocksize);
Dmsg1(200, "Create Pool: %s\n", mdb->cmd);
pr->PoolId = sql_insert_autokey_record(mdb, mdb->cmd, NT_("Pool"));
if (pr->PoolId == 0) {
Expand Down Expand Up @@ -438,9 +439,10 @@ bool db_create_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
"VolCapacityBytes,Recycle,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,"
"VolStatus,Slot,VolBytes,InChanger,VolReadTime,VolWriteTime,"
"EndFile,EndBlock,LabelType,StorageId,DeviceId,LocationId,"
"ScratchPoolId,RecyclePoolId,Enabled,ActionOnPurge,EncryptionKey)"
"ScratchPoolId,RecyclePoolId,Enabled,ActionOnPurge,EncryptionKey,"
"MinBlocksize,MaxBlocksize) "
"VALUES ('%s','%s',0,%u,%s,%s,%d,%s,%s,%u,%u,'%s',%d,%s,%d,%s,%s,0,0,%d,%s,"
"%s,%s,%s,%s,%d,%d,'%s')",
"%s,%s,%s,%s,%d,%d,'%s',%d,%d)",
esc_name,
esc_mtype, mr->PoolId,
edit_uint64(mr->MaxVolBytes,ed1),
Expand All @@ -463,7 +465,8 @@ bool db_create_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
edit_int64(mr->ScratchPoolId, ed11),
edit_int64(mr->RecyclePoolId, ed12),
mr->Enabled, mr->ActionOnPurge,
mr->EncrKey);
mr->EncrKey, mr->MinBlocksize,
mr->MaxBlocksize);

Dmsg1(500, "Create Volume: %s\n", mdb->cmd);
mr->MediaId = sql_insert_autokey_record(mdb, mdb->cmd, NT_("Media"));
Expand Down
6 changes: 4 additions & 2 deletions src/cats/sql_find.c
Expand Up @@ -337,7 +337,7 @@ int db_find_next_volume(JCR *jcr, B_DB *mdb, int item, bool InChanger, MEDIA_DBR
"EndFile,EndBlock,LabelType,LabelDate,StorageId,"
"Enabled,LocationId,RecycleCount,InitialWrite,"
"ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,"
"ActionOnPurge,EncryptionKey "
"ActionOnPurge,EncryptionKey,MinBlocksize,MaxBlocksize "
"FROM Media WHERE PoolId=%s AND MediaType='%s' AND VolStatus IN ('Full',"
"'Recycle','Purged','Used','Append') AND Enabled=1 "
"ORDER BY LastWritten LIMIT 1",
Expand All @@ -363,7 +363,7 @@ int db_find_next_volume(JCR *jcr, B_DB *mdb, int item, bool InChanger, MEDIA_DBR
"EndFile,EndBlock,LabelType,LabelDate,StorageId,"
"Enabled,LocationId,RecycleCount,InitialWrite,"
"ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,"
"ActionOnPurge,EncryptionKey "
"ActionOnPurge,EncryptionKey,MinBlocksize,MaxBlocksize "
"FROM Media WHERE PoolId=%s AND MediaType='%s' AND Enabled=1 "
"AND VolStatus='%s' "
"%s "
Expand Down Expand Up @@ -443,6 +443,8 @@ int db_find_next_volume(JCR *jcr, B_DB *mdb, int item, bool InChanger, MEDIA_DBR
mr->VolWriteTime = str_to_int64(row[35]);
mr->ActionOnPurge = str_to_int64(row[36]);
bstrncpy(mr->EncrKey, (row[37] != NULL) ? row[37] : "", sizeof(mr->EncrKey));
mr->MinBlocksize = str_to_int32(row[38]);
mr->MaxBlocksize = str_to_int32(row[39]);

sql_free_result(mdb);

Expand Down
13 changes: 8 additions & 5 deletions src/cats/sql_get.c
Expand Up @@ -608,15 +608,15 @@ bool db_get_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pdbr)
"SELECT PoolId,Name,NumVols,MaxVols,UseOnce,UseCatalog,AcceptAnyVolume,"
"AutoPrune,Recycle,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,"
"MaxVolBytes,PoolType,LabelType,LabelFormat,RecyclePoolId,ScratchPoolId,"
"ActionOnPurge FROM Pool WHERE Pool.PoolId=%s",
"ActionOnPurge,MinBlocksize,MaxBlocksize FROM Pool WHERE Pool.PoolId=%s",
edit_int64(pdbr->PoolId, ed1));
} else { /* find by name */
mdb->db_escape_string(jcr, esc, pdbr->Name, strlen(pdbr->Name));
Mmsg(mdb->cmd,
"SELECT PoolId,Name,NumVols,MaxVols,UseOnce,UseCatalog,AcceptAnyVolume,"
"AutoPrune,Recycle,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,"
"MaxVolBytes,PoolType,LabelType,LabelFormat,RecyclePoolId,ScratchPoolId,"
"ActionOnPurge FROM Pool WHERE Pool.Name='%s'", esc);
"ActionOnPurge,MinBlocksize,MaxBlocksize FROM Pool WHERE Pool.Name='%s'", esc);
}
if (QUERY_DB(jcr, mdb, mdb->cmd)) {
num_rows = sql_num_rows(mdb);
Expand Down Expand Up @@ -650,6 +650,8 @@ bool db_get_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pdbr)
pdbr->RecyclePoolId = str_to_int64(row[17]);
pdbr->ScratchPoolId = str_to_int64(row[18]);
pdbr->ActionOnPurge = str_to_int32(row[19]);
pdbr->MinBlocksize = str_to_int32(row[20]);
pdbr->MaxBlocksize = str_to_int32(row[21]);
ok = true;
}
}
Expand Down Expand Up @@ -1004,7 +1006,7 @@ bool db_get_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
"EndFile,EndBlock,LabelType,LabelDate,StorageId,"
"Enabled,LocationId,RecycleCount,InitialWrite,"
"ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,"
"ActionOnPurge,EncryptionKey "
"ActionOnPurge,EncryptionKey,MinBlocksize,MaxBlocksize "
"FROM Media WHERE MediaId=%s",
edit_int64(mr->MediaId, ed1));
} else { /* find by name */
Expand All @@ -1016,7 +1018,7 @@ bool db_get_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
"EndFile,EndBlock,LabelType,LabelDate,StorageId,"
"Enabled,LocationId,RecycleCount,InitialWrite,"
"ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,"
"ActionOnPurge,EncryptionKey "
"ActionOnPurge,EncryptionKey,MinBlocksize,MaxBlocksize "
"FROM Media WHERE VolumeName='%s'", esc);
}

Expand Down Expand Up @@ -1075,7 +1077,8 @@ bool db_get_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
mr->VolWriteTime = str_to_int64(row[35]);
mr->ActionOnPurge = str_to_int32(row[36]);
bstrncpy(mr->EncrKey, (row[37] != NULL) ? row[37] : "", sizeof(mr->EncrKey));

mr->MinBlocksize = str_to_int32(row[38]);
mr->MaxBlocksize = str_to_int32(row[39]);
retval = true;
}
} else {
Expand Down
24 changes: 17 additions & 7 deletions src/cats/sql_update.c
Expand Up @@ -272,7 +272,7 @@ bool db_update_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pr)
"AcceptAnyVolume=%d,VolRetention='%s',VolUseDuration='%s',"
"MaxVolJobs=%u,MaxVolFiles=%u,MaxVolBytes=%s,Recycle=%d,"
"AutoPrune=%d,LabelType=%d,LabelFormat='%s',RecyclePoolId=%s,"
"ScratchPoolId=%s,ActionOnPurge=%d WHERE PoolId=%s",
"ScratchPoolId=%s,ActionOnPurge=%d,MinBlockSize=%d,MaxBlockSize=%d WHERE PoolId=%s",
pr->NumVols, pr->MaxVols, pr->UseOnce, pr->UseCatalog,
pr->AcceptAnyVolume, edit_uint64(pr->VolRetention, ed1),
edit_uint64(pr->VolUseDuration, ed2),
Expand All @@ -282,6 +282,8 @@ bool db_update_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pr)
esc, edit_int64(pr->RecyclePoolId,ed5),
edit_int64(pr->ScratchPoolId,ed6),
pr->ActionOnPurge,
pr->MinBlocksize,
pr->MaxBlocksize,
ed4);
retval = UPDATE_DB(jcr, mdb, mdb->cmd);
db_unlock(mdb);
Expand Down Expand Up @@ -373,7 +375,8 @@ bool db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
"Slot=%d,InChanger=%d,VolReadTime=%s,VolWriteTime=%s,"
"LabelType=%d,StorageId=%s,PoolId=%s,VolRetention=%s,VolUseDuration=%s,"
"MaxVolJobs=%d,MaxVolFiles=%d,Enabled=%d,LocationId=%s,"
"ScratchPoolId=%s,RecyclePoolId=%s,RecycleCount=%d,Recycle=%d,ActionOnPurge=%d"
"ScratchPoolId=%s,RecyclePoolId=%s,RecycleCount=%d,Recycle=%d,ActionOnPurge=%d,"
"MinBlocksize=%u,MaxBlocksize=%u"
" WHERE VolumeName='%s'",
mr->VolJobs, mr->VolFiles, mr->VolBlocks, edit_uint64(mr->VolBytes, ed1),
mr->VolMounts, mr->VolErrors, mr->VolWrites,
Expand All @@ -390,7 +393,8 @@ bool db_update_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
mr->Enabled, edit_uint64(mr->LocationId, ed9),
edit_uint64(mr->ScratchPoolId, ed10),
edit_uint64(mr->RecyclePoolId, ed11),
mr->RecycleCount,mr->Recycle, mr->ActionOnPurge,
mr->RecycleCount, mr->Recycle, mr->ActionOnPurge,
mr->MinBlocksize, mr->MaxBlocksize,
esc_name);

Dmsg1(400, "%s\n", mdb->cmd);
Expand Down Expand Up @@ -420,25 +424,31 @@ bool db_update_media_defaults(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
if (mr->VolumeName[0]) {
mdb->db_escape_string(jcr, esc, mr->VolumeName, strlen(mr->VolumeName));
Mmsg(mdb->cmd, "UPDATE Media SET "
"ActionOnPurge=%d, Recycle=%d,VolRetention=%s,VolUseDuration=%s,"
"MaxVolJobs=%u,MaxVolFiles=%u,MaxVolBytes=%s,RecyclePoolId=%s"
"ActionOnPurge=%d,Recycle=%d,VolRetention=%s,VolUseDuration=%s,"
"MaxVolJobs=%u,MaxVolFiles=%u,MaxVolBytes=%s,RecyclePoolId=%s,"
"MinBlocksize=%d,MaxBlocksize=%d"
" WHERE VolumeName='%s'",
mr->ActionOnPurge, mr->Recycle,edit_uint64(mr->VolRetention, ed1),
edit_uint64(mr->VolUseDuration, ed2),
mr->MaxVolJobs, mr->MaxVolFiles,
edit_uint64(mr->MaxVolBytes, ed3),
edit_uint64(mr->RecyclePoolId, ed4),
mr->MinBlocksize,
mr->MaxBlocksize,
esc);
} else {
Mmsg(mdb->cmd, "UPDATE Media SET "
"ActionOnPurge=%d, Recycle=%d,VolRetention=%s,VolUseDuration=%s,"
"MaxVolJobs=%u,MaxVolFiles=%u,MaxVolBytes=%s,RecyclePoolId=%s"
"ActionOnPurge=%d,Recycle=%d,VolRetention=%s,VolUseDuration=%s,"
"MaxVolJobs=%u,MaxVolFiles=%u,MaxVolBytes=%s,RecyclePoolId=%s,"
"MinBlocksize=%d,MaxBlocksize=%d"
" WHERE PoolId=%s",
mr->ActionOnPurge, mr->Recycle,edit_uint64(mr->VolRetention, ed1),
edit_uint64(mr->VolUseDuration, ed2),
mr->MaxVolJobs, mr->MaxVolFiles,
edit_uint64(mr->MaxVolBytes, ed3),
edit_int64(mr->RecyclePoolId, ed4),
mr->MinBlocksize,
mr->MaxBlocksize,
edit_int64(mr->PoolId, ed5));
}

Expand Down
4 changes: 2 additions & 2 deletions src/dird/catreq.c
Expand Up @@ -68,7 +68,7 @@ static char OK_media[] =
" MaxVolBytes=%s VolCapacityBytes=%s VolStatus=%s Slot=%d"
" MaxVolJobs=%u MaxVolFiles=%u InChanger=%d VolReadTime=%s"
" VolWriteTime=%s EndFile=%u EndBlock=%u LabelType=%d"
" MediaId=%s EncryptionKey=%s\n";
" MediaId=%s EncryptionKey=%s MinBlocksize=%d MaxBlocksize=%d\n";
static char OK_create[] =
"1000 OK CreateJobMedia\n";

Expand All @@ -92,7 +92,7 @@ static int send_volume_info_to_storage_daemon(JCR *jcr, BSOCK *sd, MEDIA_DBR *mr
mr->EndFile, mr->EndBlock,
mr->LabelType,
edit_uint64(mr->MediaId, ed6),
mr->EncrKey);
mr->EncrKey, mr->MinBlocksize, mr->MaxBlocksize);
unbash_spaces(mr->VolumeName);
Dmsg2(100, "Vol Info for %s: %s", jcr->Job, sd->msg);
return status;
Expand Down
4 changes: 4 additions & 0 deletions src/dird/dird_conf.c
Expand Up @@ -455,6 +455,8 @@ static RES_ITEM pool_items[] = {
{ "catalog", store_res, ITEM(res_pool.catalog), R_CATALOG, 0, NULL },
{ "fileretention", store_time, ITEM(res_pool.FileRetention), 0, 0, NULL },
{ "jobretention", store_time, ITEM(res_pool.JobRetention), 0, 0, NULL },
{ "minimumblocksize", store_pint32, ITEM(res_pool.MinBlocksize), 0, 0, NULL },
{ "maximumblocksize", store_pint32, ITEM(res_pool.MaxBlocksize), 0, 0, NULL },
{ NULL, NULL, { 0 }, 0, 0, NULL }
};

Expand Down Expand Up @@ -1136,6 +1138,8 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
sendit(sock, _(" max_vols=%d auto_prune=%d VolRetention=%s\n"),
res->res_pool.max_volumes, res->res_pool.AutoPrune,
edit_utime(res->res_pool.VolRetention, ed1, sizeof(ed1)));
sendit(sock, _(" minblocksize=%d maxblocksize=%d\n"),
res->res_pool.MinBlocksize, res->res_pool.MaxBlocksize);
sendit(sock, _(" VolUse=%s recycle=%d LabelFormat=%s\n"),
edit_utime(res->res_pool.VolUseDuration, ed1, sizeof(ed1)),
res->res_pool.Recycle,
Expand Down
2 changes: 2 additions & 0 deletions src/dird/dird_conf.h
Expand Up @@ -607,6 +607,8 @@ class POOLRES {
CATRES *catalog; /* Catalog to be used */
utime_t FileRetention; /* file retention period in seconds */
utime_t JobRetention; /* job retention period in seconds */
uint32_t MinBlocksize; /* Minimum Blocksize */
uint32_t MaxBlocksize; /* Maximum Blocksize */

/* Methods */
char *name() const;
Expand Down
7 changes: 6 additions & 1 deletion src/dird/ua_cmds.c
Expand Up @@ -309,6 +309,8 @@ void set_pool_dbr_defaults_in_media_dbr(MEDIA_DBR *mr, POOL_DBR *pr)
mr->MaxVolFiles = pr->MaxVolFiles;
mr->MaxVolBytes = pr->MaxVolBytes;
mr->LabelType = pr->LabelType;
mr->MinBlocksize = pr->MinBlocksize;
mr->MaxBlocksize = pr->MaxBlocksize;
mr->Enabled = 1;
}

Expand Down Expand Up @@ -555,7 +557,7 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
* Pool DB base record from a Pool Resource. We handle
* the setting of MaxVols and NumVols slightly differently
* depending on if we are creating the Pool or we are
* simply bringing it into agreement with the resource (updage).
* simply bringing it into agreement with the resource (update).
*
* Caution : RecyclePoolId isn't setup in this function.
* You can use set_pooldbr_recyclepoolid();
Expand Down Expand Up @@ -585,6 +587,9 @@ void set_pooldbr_from_poolres(POOL_DBR *pr, POOLRES *pool, e_pool_op op)
pr->MaxVolBytes = pool->MaxVolBytes;
pr->AutoPrune = pool->AutoPrune;
pr->ActionOnPurge = pool->action_on_purge;
pr->ActionOnPurge = pool->action_on_purge;
pr->MinBlocksize = pool->MinBlocksize;
pr->MaxBlocksize = pool->MaxBlocksize;
pr->Recycle = pool->Recycle;
if (pool->label_format) {
bstrncpy(pr->LabelFormat, pool->label_format, sizeof(pr->LabelFormat));
Expand Down
27 changes: 18 additions & 9 deletions src/dird/ua_label.c
Expand Up @@ -412,8 +412,7 @@ static void label_from_barcodes(UAContext *ua, int drive, bool label_encrypt)
set_storageid_in_mr(store, &mr);

/*
* Deal with creating cleaning tape here. Normal tapes created in
* send_label_request() below
* Deal with creating cleaning tape here. Normal tapes created in send_label_request() below
*/
if (is_cleaning_tape(ua, &mr, &pr)) {
if (media_record_exists) { /* we update it */
Expand Down Expand Up @@ -458,7 +457,7 @@ static void label_from_barcodes(UAContext *ua, int drive, bool label_encrypt)
}

mr.Slot = vl->Slot;
send_label_request(ua, &mr, &omr, &pr, 0, media_record_exists, drive);
send_label_request(ua, &mr, &omr, &pr, false, media_record_exists, drive);
}

bail_out:
Expand Down Expand Up @@ -555,20 +554,30 @@ static bool send_label_request(UAContext *ua, MEDIA_DBR *mr, MEDIA_DBR *omr,
if (relabel) {
bash_spaces(omr->VolumeName);
sd->fsend("relabel %s OldName=%s NewName=%s PoolName=%s "
"MediaType=%s Slot=%d drive=%d",
"MediaType=%s Slot=%d drive=%d MinBlocksize=%d MaxBlocksize=%d",
dev_name, omr->VolumeName, mr->VolumeName, pr->Name,
mr->MediaType, mr->Slot, drive);
mr->MediaType, mr->Slot, drive,
/*
* if relabeling, keep blocksize settings
*/
omr->MinBlocksize, omr->MaxBlocksize);
ua->send_msg(_("Sending relabel command from \"%s\" to \"%s\" ...\n"),
omr->VolumeName, mr->VolumeName);
} else {
sd->fsend("label %s VolumeName=%s PoolName=%s MediaType=%s "
"Slot=%d drive=%d",
"Slot=%d drive=%d MinBlocksize=%d MaxBlocksize=%d",
dev_name, mr->VolumeName, pr->Name, mr->MediaType,
mr->Slot, drive);
mr->Slot, drive,
/*
* if labeling, use blocksize defined in pool
*/
pr->MinBlocksize, pr->MaxBlocksize);
ua->send_msg(_("Sending label command for Volume \"%s\" Slot %d ...\n"),
mr->VolumeName, mr->Slot);
Dmsg6(100, "label %s VolumeName=%s PoolName=%s MediaType=%s Slot=%d drive=%d\n",
dev_name, mr->VolumeName, pr->Name, mr->MediaType, mr->Slot, drive);
Dmsg8(100, "label %s VolumeName=%s PoolName=%s MediaType=%s "
"Slot=%d drive=%d MinBlocksize=%d MaxBlocksize=%d\n",
dev_name, mr->VolumeName, pr->Name, mr->MediaType, mr->Slot, drive,
pr->MinBlocksize, pr->MaxBlocksize);
}

/*
Expand Down
5 changes: 4 additions & 1 deletion src/lib/scan.c
Expand Up @@ -544,6 +544,8 @@ struct VOLUME_CAT_INFO {
uint64_t VolCatCapacityBytes; /* capacity estimate */
uint64_t VolReadTime; /* time spent reading */
uint64_t VolWriteTime; /* time spent writing this Volume */
uint32_t MinBlocksize; /* Minimum block size */
uint32_t MaxBlocksize; /* Maximum block size */
char VolCatStatus[20]; /* Volume status */
char VolCatName[MAX_NAME_LENGTH]; /* Desired volume to mount */
};
Expand All @@ -569,7 +571,8 @@ struct VOLUME_CAT_INFO {
&vol.VolCatWrites, &vol.VolCatMaxBytes,
&vol.VolCatCapacityBytes, vol.VolCatStatus,
&vol.Slot, &vol.VolCatMaxJobs, &vol.VolCatMaxFiles,
&vol.InChanger, &vol.VolReadTime, &vol.VolWriteTime);
&vol.InChanger, &vol.VolReadTime, &vol.VolWriteTime,
&vol.MaxBlocksize, &vol.MinBocksize);
printf("cnt=%d Vol=%s\n", cnt, vol.VolCatName);

}
Expand Down

0 comments on commit 860aaeb

Please sign in to comment.