mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-05 06:10:13 -05:00
More interface changes to prepare to the use of tree mapping
This commit is contained in:
parent
f719ee4f57
commit
fa775d24a8
12 changed files with 295 additions and 314 deletions
|
|
@ -58,9 +58,10 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
|||
/* for each disk, process the block */
|
||||
for (j = 0; j < diskmax; ++j) {
|
||||
int read_size;
|
||||
struct snapraid_block* block = BLOCK_EMPTY;
|
||||
struct snapraid_block* block;
|
||||
struct snapraid_disk* disk = handle[j].disk;
|
||||
struct snapraid_file* file;
|
||||
block_off_t file_pos;
|
||||
|
||||
if (!disk) {
|
||||
/* if no disk, nothing to do */
|
||||
|
|
@ -75,7 +76,7 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
|||
}
|
||||
|
||||
/* get the file of this block */
|
||||
file = block_file_get(block);
|
||||
file = fs_par2file_get(disk, i, &file_pos);
|
||||
|
||||
/* until now is CPU */
|
||||
state_usage_cpu(state);
|
||||
|
|
@ -108,9 +109,9 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
|
|||
}
|
||||
|
||||
/* read from the file */
|
||||
read_size = handle_read(&handle[j], block, buffer_aligned, state->block_size, log_error, 0);
|
||||
read_size = handle_read(&handle[j], file_pos, buffer_aligned, state->block_size, log_error, 0);
|
||||
if (read_size == -1) {
|
||||
log_tag("error:%u:%s:%s: Read error at position %u\n", i, disk->name, esc(file->sub), block_file_pos(block));
|
||||
log_tag("error:%u:%s:%s: Read error at position %u\n", i, disk->name, esc(file->sub), file_pos);
|
||||
++error;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue