2019-11-03 22:04:25 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class blockstore_init_meta
|
|
|
|
{
|
|
|
|
blockstore *bs;
|
2019-11-04 01:42:40 +03:00
|
|
|
uint8_t *metadata_buffer = NULL;
|
2019-11-03 22:04:25 +03:00
|
|
|
uint64_t metadata_read = 0;
|
|
|
|
struct iovec submit_iov;
|
|
|
|
int prev = 0, prev_done = 0, done_len = 0, submitted = 0, done_cnt = 0;
|
2019-11-04 01:42:40 +03:00
|
|
|
void handle_entries(struct clean_disk_entry* entries, int count);
|
2019-11-03 22:04:25 +03:00
|
|
|
public:
|
|
|
|
blockstore_init_meta(blockstore* bs);
|
|
|
|
int read_loop();
|
|
|
|
};
|
|
|
|
|
|
|
|
class blockstore_init_journal
|
|
|
|
{
|
|
|
|
blockstore *bs;
|
2019-11-04 01:42:40 +03:00
|
|
|
uint8_t *journal_buffer = NULL;
|
|
|
|
int step = 0;
|
|
|
|
uint32_t crc32_last = 0;
|
|
|
|
struct iovec submit_iov;
|
|
|
|
uint64_t done_pos = 0, journal_pos = 0;
|
|
|
|
uint64_t cur_skip = 0;
|
|
|
|
int submitted = 0, done_buf = 0, done_len = 0;
|
|
|
|
int handle_journal(void *buf, int len);
|
2019-11-03 22:04:25 +03:00
|
|
|
public:
|
|
|
|
blockstore_init_journal(blockstore* bs);
|
|
|
|
int read_loop();
|
|
|
|
};
|