dedup

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

commit ca0493fa7861e7fd5bcdc108d7f56c4109d09fae
parent d68ea46d747443f91d963fce511b5fbf46ad11aa
Author: sin <sin@2f30.org>
Date:   Wed,  8 May 2019 00:57:04 +0100

Align some comments

Diffstat:
Mbstorage.c | 28++++++++++++++--------------
Msnap.c | 14+++++++-------
2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/bstorage.c b/bstorage.c @@ -82,30 +82,30 @@ static struct bops bops = { /* Block header structure */ struct bhdr { char magic[NBHDRMAGIC]; /* magic number for file(1) */ - uint64_t flags; /* version number, compression/encryption configuration */ - uint64_t nbd; /* number of block descriptors */ + uint64_t flags; /* version number, compression/encryption configuration */ + uint64_t nbd; /* number of block descriptors */ }; /* Block descriptor */ struct bd { - uint16_t type; /* BDTYPE */ - uint8_t reserved[6]; /* should be set to 0 when writing */ - uint64_t offset; /* block offset */ - uint64_t size; /* block size */ - uint64_t refcnt; /* reference count of block, 0 if block is removed */ + uint16_t type; /* BDTYPE */ + uint8_t reserved[6]; /* should be set to 0 when writing */ + uint64_t offset; /* block offset */ + uint64_t size; /* block size */ + uint64_t refcnt; /* reference count of block, 0 if block is removed */ unsigned char md[MDSIZE]; /* hash of block */ - RB_ENTRY(bd) rbe; /* bdcache link node */ - SLIST_ENTRY(bd) sle; /* gchead link node */ + RB_ENTRY(bd) rbe; /* bdcache link node */ + SLIST_ENTRY(bd) sle; /* gchead link node */ }; RB_HEAD(bdcache, bd); - + /* Storage layer context */ struct sctx { - struct bdcache bdcache; /* cache of block descriptors */ + struct bdcache bdcache; /* cache of block descriptors */ SLIST_HEAD(gchead, bd) gchead; /* list of all blocks with a zero refcount */ - int fd; /* underlying storage file descriptor */ - int rdonly; /* when set to 1, the bssync() operation is a no-op */ - struct bhdr bhdr; /* block header */ + int fd; /* underlying storage file descriptor */ + int rdonly; /* when set to 1, the bssync() operation is a no-op */ + struct bhdr bhdr; /* block header */ }; static int diff --git a/snap.c b/snap.c @@ -37,11 +37,11 @@ extern int unpack(unsigned char *, char *, ...); /* Snapshot header structure */ struct shdr { - char magic[NSHDRMAGIC]; /* magic number for file(1) */ + char magic[NSHDRMAGIC]; /* magic number for file(1) */ unsigned char nonce[crypto_aead_xchacha20poly1305_ietf_NPUBBYTES]; unsigned char header[crypto_secretstream_xchacha20poly1305_HEADERBYTES]; - uint64_t flags; /* version number */ - uint64_t nbd; /* number of block hashes */ + uint64_t flags; /* version number */ + uint64_t nbd; /* number of block hashes */ }; struct mdnode { @@ -51,10 +51,10 @@ struct mdnode { struct sctx { TAILQ_HEAD(mdhead, mdnode) mdhead; /* list of hashes contained in snapshot */ - struct mdnode *mdnext; /* next hash to be returned via sget() */ - int fd; /* underlying snapshot file descriptor */ - int rdonly; /* when set to 1, the ssync() operation is a no-op */ - struct shdr shdr; /* snapshot header */ + struct mdnode *mdnext; /* next hash to be returned via sget() */ + int fd; /* underlying snapshot file descriptor */ + int rdonly; /* when set, ssync() is a no-op */ + struct shdr shdr; /* snapshot header */ }; static char errbuf[NERRBUF];