2025-02-23 20:52:59 +00:00
|
|
|
#ifndef CHUNK_TABLE_H_
|
|
|
|
|
#define CHUNK_TABLE_H_
|
|
|
|
|
|
|
|
|
|
#include "bin.h"
|
|
|
|
|
|
|
|
|
|
#include <blue/core/btree.h>
|
|
|
|
|
#include <blue/core/hash.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2025-02-24 15:55:26 +00:00
|
|
|
struct ec3_tag_ioctx;
|
2025-02-23 20:52:59 +00:00
|
|
|
|
|
|
|
|
struct chunk_table {
|
2025-02-24 15:55:26 +00:00
|
|
|
enum ec3_cluster_size tab_cluster_size;
|
2025-02-23 20:52:59 +00:00
|
|
|
b_btree tab_cache;
|
|
|
|
|
|
2025-02-24 15:55:26 +00:00
|
|
|
struct ec3_tag_ioctx *tab_ctab;
|
|
|
|
|
struct ec3_tag_ioctx *tab_cdat;
|
2025-02-23 20:52:59 +00:00
|
|
|
};
|
|
|
|
|
|
2025-02-24 15:55:26 +00:00
|
|
|
extern enum ec3_status chunk_table_init(
|
|
|
|
|
struct ec3_tag_ioctx *ctab,
|
|
|
|
|
struct ec3_tag_ioctx *cdat,
|
|
|
|
|
enum ec3_cluster_size cluster_size,
|
2025-02-23 20:52:59 +00:00
|
|
|
struct chunk_table *tab);
|
|
|
|
|
extern void chunk_table_finish(struct chunk_table *tab);
|
|
|
|
|
|
|
|
|
|
extern enum ec3_status chunk_table_get(
|
|
|
|
|
struct chunk_table *tab,
|
|
|
|
|
ec3_chunk_id id,
|
|
|
|
|
void *out_data,
|
|
|
|
|
size_t *out_len);
|
|
|
|
|
|
|
|
|
|
extern enum ec3_status chunk_table_put(
|
|
|
|
|
struct chunk_table *tab,
|
|
|
|
|
const void *data,
|
|
|
|
|
size_t len,
|
|
|
|
|
ec3_chunk_id out_id);
|
|
|
|
|
|
|
|
|
|
extern size_t chunk_table_bytes_per_chunk(struct chunk_table *tab);
|
|
|
|
|
|
|
|
|
|
#endif
|