tape: media_catalog: improve chunk_archive interface

instead of having a public start/end_chunk_archive and register_chunks,
simply expose a 'register_chunk_archive' method since we always have
a list of chunks anywhere we want to add them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2021-07-22 15:41:00 +02:00
committed by Dietmar Maurer
parent 9a1ecae0b7
commit a2ef36d445
3 changed files with 22 additions and 13 deletions

View File

@ -97,11 +97,7 @@ impl CatalogSet {
) -> Result<(), Error> {
match self.catalog {
Some(ref mut catalog) => {
catalog.start_chunk_archive(uuid, file_number, store)?;
for digest in chunk_list {
catalog.register_chunk(digest)?;
}
catalog.end_chunk_archive()?;
catalog.register_chunk_archive(uuid, file_number, store, chunk_list)?;
}
None => bail!("no catalog loaded - internal error"),
}