diff options
author | Yunchih Chen <yunchih.cat@gmail.com> | 2018-03-18 21:10:49 +0800 |
---|---|---|
committer | Yunchih Chen <yunchih.cat@gmail.com> | 2018-03-18 21:10:49 +0800 |
commit | d6fe4152d0a213cc64336853271188371c9d3563 (patch) | |
tree | 9a69e6900bb96a9e2906c14840968a92c9eab159 /lib/commit.c | |
parent | 597453d4b147cb0e07704e1dec455cfc7cebe382 (diff) | |
download | nfcollect-d6fe4152d0a213cc64336853271188371c9d3563.tar.gz nfcollect-d6fe4152d0a213cc64336853271188371c9d3563.tar.zst nfcollect-d6fe4152d0a213cc64336853271188371c9d3563.zip |
Format with clang-format
Diffstat (limited to 'lib/commit.c')
-rw-r--r-- | lib/commit.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/commit.c b/lib/commit.c index ca90598..f2fbc06 100644 --- a/lib/commit.c +++ b/lib/commit.c @@ -8,7 +8,8 @@ static void nfl_commit_default(FILE *f, nfl_entry_t *store, static void nfl_commit_lz4(FILE *f, nfl_entry_t *store, uint32_t store_size); static void nfl_commit_zstd(FILE *f, nfl_entry_t *store, uint32_t store_size); -void nfl_commit_init() { /* TODO */ } +void nfl_commit_init() { /* TODO */ +} static void nfl_commit_default(FILE *f, nfl_entry_t *store, uint32_t store_size) { @@ -21,8 +22,7 @@ static void nfl_commit_lz4(FILE *f, nfl_entry_t *store, uint32_t store_size) { /* TODO */ } -static void nfl_commit_zstd(FILE *f, nfl_entry_t *store, - uint32_t store_size) { +static void nfl_commit_zstd(FILE *f, nfl_entry_t *store, uint32_t store_size) { size_t const bufsize = ZSTD_compressBound(store_size); void *buf; @@ -50,21 +50,22 @@ void nfl_commit_worker(nfl_header_t *header, nfl_entry_t *store, // commit store uint32_t store_size = sizeof(nfl_entry_t) * header->max_n_entries; - switch(compression_opt) { - case COMPRESS_NONE: - debug("Comm worker #%u: commit without compression\n", header->id) + switch (compression_opt) { + case COMPRESS_NONE: + debug("Comm worker #%u: commit without compression\n", header->id) nfl_commit_default(f, store, store_size); - break; - case COMPRESS_LZ4: - debug("Comm worker #%u: commit with compression algorithm: lz4", header->id) - nfl_commit_lz4(f, store, store_size); - break; - case COMPRESS_ZSTD: - debug("Comm worker #%u: commit with compression algorithm: zstd", header->id) - nfl_commit_zstd(f, store, store_size); - break; - // Must not reach here ... - default: FATAL("Unknown compression option detected"); + break; + case COMPRESS_LZ4: + debug("Comm worker #%u: commit with compression algorithm: lz4", + header->id) nfl_commit_lz4(f, store, store_size); + break; + case COMPRESS_ZSTD: + debug("Comm worker #%u: commit with compression algorithm: zstd", + header->id) nfl_commit_zstd(f, store, store_size); + break; + // Must not reach here ... + default: + FATAL("Unknown compression option detected"); } // Do fsync ? |