dedup

deduplicating backup program
git clone git://git.2f30.org/dedup
Log | Files | Refs | README | LICENSE

commit 1e0ae643c3d751e822d518af206d1701d77b9b1a
parent 02140831ff35a825f0c92f9e63945316f740737e
Author: sin <sin@2f30.org>
Date:   Fri, 26 Apr 2019 17:55:10 +0100

Remove indentation level

Diffstat:
Mbstorage.c | 29+++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)

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; }