Remove indentation level - dedup - deduplicating backup program
HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit 1e0ae643c3d751e822d518af206d1701d77b9b1a
DIR parent 02140831ff35a825f0c92f9e63945316f740737e
HTML Author: sin <sin@2f30.org>
Date: Fri, 26 Apr 2019 17:55:10 +0100
Remove indentation level
Diffstat:
M bstorage.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
---
DIR diff --git a/bstorage.c b/bstorage.c
@@ -577,22 +577,23 @@ bsrm(struct bctx *bctx, unsigned char *md)
return -1;
}
- if (bd->refcnt == 0) {
- if (punchhole(sctx->fd, bd->offset, bd->size) < 0) {
- /*
- * Filesystem does not support hole punching.
- * Try to recover the block descriptor so we don't
- * lose track of the block.
- */
- lseek(sctx->fd, bdoffs, SEEK_SET);
- bd->refcnt++;
- packbd(sctx->fd, bd);
- return -1;
- }
+ if (bd->refcnt > 0)
+ return 0;
- RB_REMOVE(bdcache, &sctx->bdcache, bd);
- SLIST_INSERT_HEAD(&sctx->gchead, bd, sle);
+ if (punchhole(sctx->fd, bd->offset, bd->size) < 0) {
+ /*
+ * Filesystem does not support hole punching.
+ * Try to recover the block descriptor so we don't
+ * lose track of the block.
+ */
+ lseek(sctx->fd, bdoffs, SEEK_SET);
+ bd->refcnt++;
+ packbd(sctx->fd, bd);
+ return -1;
}
+
+ RB_REMOVE(bdcache, &sctx->bdcache, bd);
+ SLIST_INSERT_HEAD(&sctx->gchead, bd, sle);
return 0;
}