From: norbert.bizet Date: Mon, 28 Mar 2022 14:16:33 +0000 (-0400) Subject: cloud: remove useless hash checks X-Git-Tag: Release-13.0.0~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a9c5238a663e144fa6b8e38bb4c82d513ef722e;p=thirdparty%2Fbacula.git cloud: remove useless hash checks --- diff --git a/bacula/src/stored/cloud_dev.c b/bacula/src/stored/cloud_dev.c index c495ae3e5..155c9b479 100644 --- a/bacula/src/stored/cloud_dev.c +++ b/bacula/src/stored/cloud_dev.c @@ -1807,11 +1807,7 @@ bool cloud_dev::truncate(DCR *dcr) part->index = tpkt->m_part; part->mtime = tpkt->m_res_mtime; part->size = tpkt->m_res_size; - if (tpkt->m_hash64) { - memcpy(part->hash64, tpkt->m_hash64, 64); - } else { - bmemzero(part->hash64, 64); - } + memcpy(part->hash64, tpkt->m_hash64, 64); iuploads->put(part->index, part); } /* returns the list of items to truncate : cloud parts-uploads*/ diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index 8bd7e70e1..c48b4f8ae 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -849,11 +849,7 @@ static bool cloud_list_cmd(JCR *jcr) for (int i=1; i <= parts.last_index() ; i++) { cloud_part *p = (cloud_part *)parts.get(i); if (p) { - if (p->hash64) { - dir->fsend("part=%d size=%lld mtime=%lld hash=%s\n", i, p->size, p->mtime, p->hash64); - } else { - dir->fsend("part=%d size=%lld mtime=%lld hash=%s\n", i, p->size, p->mtime); - } + dir->fsend("part=%d size=%lld mtime=%lld hash=%s\n", i, p->size, p->mtime, p->hash64); free(p); } }