dedup

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

commit 2a1b814e1085c97b0a76d1b8cf1379032bb16adb
parent 1e0ae643c3d751e822d518af206d1701d77b9b1a
Author: sin <sin@2f30.org>
Date:   Fri, 26 Apr 2019 17:59:39 +0100

Rename field

Diffstat:
Mbstorage.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bstorage.c b/bstorage.c @@ -78,7 +78,7 @@ static struct bops bops = { struct bhdr { char magic[NBHDRMAGIC]; uint64_t flags; - uint64_t nent; + uint64_t nbd; }; /* Block descriptor */ @@ -182,7 +182,7 @@ unpackbhdr(int fd, struct bhdr *bhdr) n = unpack(buf, "'16qq", bhdr->magic, &bhdr->flags, - &bhdr->nent); + &bhdr->nbd); assert(n == sizeof(buf)); return n; @@ -198,7 +198,7 @@ packbhdr(int fd, struct bhdr *bhdr) n = pack(buf, "'16qq", bhdr->magic, bhdr->flags, - bhdr->nent); + bhdr->nbd); assert(n == BHDRSIZE); if (xwrite(fd, buf, n) != n) @@ -292,7 +292,7 @@ initbdcache(struct sctx *sctx) uint64_t i; bhdr = &sctx->bhdr; - for (i = 0; i < bhdr->nent; i++) { + for (i = 0; i < bhdr->nbd; i++) { struct bd *bd, *tmp; if (loadbd(sctx) == 0) @@ -360,7 +360,7 @@ bscreat(struct bctx *bctx, char *path, int mode, struct bparam *bpar) return -1; } - bhdr->nent = 0; + bhdr->nbd = 0; sctx->fd = fd; if (packbhdr(fd, bhdr) < 0) { @@ -519,7 +519,7 @@ bsput(struct bctx *bctx, void *buf, size_t n, unsigned char *md) } bhdr = &sctx->bhdr; - bhdr->nent++; + bhdr->nbd++; RB_INSERT(bdcache, &sctx->bdcache, bd); memcpy(md, bd->md, MDSIZE); return bd->size;