| 409 | }; |
| 410 | |
| 411 | static const char *midx_compaction_step_base(const struct midx_compaction_step *step) |
| 412 | { |
| 413 | switch (step->type) { |
| 414 | case MIDX_COMPACTION_STEP_UNKNOWN: |
| 415 | BUG("cannot use UNKNOWN step as a base"); |
| 416 | case MIDX_COMPACTION_STEP_COPY: |
| 417 | return midx_get_checksum_hex(step->u.copy); |
| 418 | case MIDX_COMPACTION_STEP_WRITE: |
| 419 | BUG("cannot use WRITE step as a base"); |
| 420 | case MIDX_COMPACTION_STEP_COMPACT: |
| 421 | return midx_get_checksum_hex(step->u.compact.to); |
| 422 | default: |
| 423 | BUG("unhandled midx compaction step type %d", step->type); |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | static int midx_compaction_step_exec_copy(struct midx_compaction_step *step) |
| 428 | { |
no test coverage detected