libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
erasure_internal.h
Go to the documentation of this file.
1/*
2 * This file is part of the Aaru Data Preservation Suite.
3 * Copyright (c) 2019-2026 Natalia Portillo.
4 *
5 * This library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef LIBAARUFORMAT_ERASURE_INTERNAL_H
20#define LIBAARUFORMAT_ERASURE_INTERNAL_H
21
22#include "aaruformat/context.h"
24
25/* ---- Write path ---- */
26
27void ec_accumulate_data_block(aaruformat_context *ctx, const BlockHeader *block_header, const uint8_t *lzma_props,
28 const uint8_t *payload, uint32_t payload_size, uint64_t file_offset);
29
30void ec_flush_data_stripe(aaruformat_context *ctx, uint32_t slot);
31
33
34/* ---- Read path ---- */
35
44
59int32_t ec_recover_data_block(aaruformat_context *ctx, uint64_t block_offset, uint64_t offset,
60 uint8_t *data, uint32_t *length, uint8_t sector_status);
61
62/* ---- Cleanup ---- */
63
65
66#endif /* LIBAARUFORMAT_ERASURE_INTERNAL_H */
Central runtime context structures for libaaruformat (image state, caches, checksum buffers).
On-disk layout structures for data-bearing and geometry blocks.
void ec_load_ecmb(aaruformat_context *ctx)
Try to load the ECMB from the recovery footer at EOF.
Definition erasure.c:941
void ec_finalize(aaruformat_context *ctx)
Flush all partial data stripes and write parity for all groups + ECMB + recovery footer.
Definition erasure.c:690
void ec_accumulate_data_block(aaruformat_context *ctx, const BlockHeader *block_header, const uint8_t *lzma_props, const uint8_t *payload, uint32_t payload_size, uint64_t file_offset)
Accumulate parity for a data block that was just written to disk.
Definition erasure.c:228
int32_t ec_recover_data_block(aaruformat_context *ctx, uint64_t block_offset, uint64_t offset, uint8_t *data, uint32_t *length, uint8_t sector_status)
Attempt to recover a data block that failed decompression or CRC verification.
Definition erasure.c:1145
void ec_flush_data_stripe(aaruformat_context *ctx, uint32_t slot)
Write M parity blocks for a completed data stripe slot and record the stripe descriptor.
Definition erasure.c:304
void ec_free(aaruformat_context *ctx)
Free all erasure coding state from the context.
Definition erasure.c:876
Header preceding the compressed data payload of a data block (BlockType::DataBlock).
Definition data.h:71
Master context representing an open or in‑creation Aaru image.
Definition context.h:175