iAdd some comments to bsrm() - dedup - deduplicating backup program Err bitreich.org 70 hgit clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ URL:git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ bitreich.org 70 1Log /scm/dedup/log.gph bitreich.org 70 1Files /scm/dedup/files.gph bitreich.org 70 1Refs /scm/dedup/refs.gph bitreich.org 70 1Tags /scm/dedup/tag bitreich.org 70 1README /scm/dedup/file/README.gph bitreich.org 70 1LICENSE /scm/dedup/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit baf29fa2203239eb1767c97b48e093364c7c9f46 /scm/dedup/commit/baf29fa2203239eb1767c97b48e093364c7c9f46.gph bitreich.org 70 1parent 00d03339c89087d34d11f3147daae28de6f94c7a /scm/dedup/commit/00d03339c89087d34d11f3147daae28de6f94c7a.gph bitreich.org 70 hAuthor: sin URL:mailto:sin@2f30.org bitreich.org 70 iDate: Thu, 25 Apr 2019 22:46:18 +0100 Err bitreich.org 70 i Err bitreich.org 70 iAdd some comments to bsrm() Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M bstorage.c | 6 ++++++ Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 6 insertions(+), 0 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/bstorage.c b/bstorage.c /scm/dedup/file/bstorage.c.gph bitreich.org 70 i@@ -538,6 +538,7 @@ bsget(struct bctx *bctx, unsigned char *md, void *buf, size_t *n) Err bitreich.org 70 i return 0; Err bitreich.org 70 i } Err bitreich.org 70 i Err bitreich.org 70 i+/* Remove a block with the given hash */ Err bitreich.org 70 i static int Err bitreich.org 70 i bsrm(struct bctx *bctx, unsigned char *md) Err bitreich.org 70 i { Err bitreich.org 70 i@@ -568,6 +569,11 @@ bsrm(struct bctx *bctx, unsigned char *md) Err bitreich.org 70 i Err bitreich.org 70 i mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE; Err bitreich.org 70 i if (fallocate(sctx->fd, mode, bd->offset, bd->size) < 0) { Err bitreich.org 70 i+ /* Err bitreich.org 70 i+ * Filesystem does not support hole punching. Err bitreich.org 70 i+ * Try to recover the block descriptor so we don't Err bitreich.org 70 i+ * lose track of the block. Err bitreich.org 70 i+ */ Err bitreich.org 70 i lseek(sctx->fd, bdoffs, SEEK_SET); Err bitreich.org 70 i bd->refcnt++; Err bitreich.org 70 i packbd(sctx->fd, bd); Err bitreich.org 70 .