mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 12:57:14 -05:00
Avoids to allocate unused space in the block array.
This commit is contained in:
parent
63b7bce7a5
commit
7c476cd40d
1 changed files with 3 additions and 3 deletions
6
state.c
6
state.c
|
|
@ -2345,9 +2345,6 @@ static void state_read_binary(struct snapraid_state* state, const char* path, ST
|
||||||
}
|
}
|
||||||
disk = tommy_array_get(&disk_mapping, mapping);
|
disk = tommy_array_get(&disk_mapping, mapping);
|
||||||
|
|
||||||
/* grow the array */
|
|
||||||
tommy_array_grow(&disk->blockarr, blockmax);
|
|
||||||
|
|
||||||
v_pos = 0;
|
v_pos = 0;
|
||||||
while (v_pos < blockmax) {
|
while (v_pos < blockmax) {
|
||||||
uint32_t v_count;
|
uint32_t v_count;
|
||||||
|
|
@ -2369,6 +2366,9 @@ static void state_read_binary(struct snapraid_state* state, const char* path, ST
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'o' :
|
case 'o' :
|
||||||
|
/* grow the array */
|
||||||
|
tommy_array_grow(&disk->blockarr, v_pos + v_count);
|
||||||
|
|
||||||
/* if it's a run of deleted blocks */
|
/* if it's a run of deleted blocks */
|
||||||
while (v_count) {
|
while (v_count) {
|
||||||
struct snapraid_deleted* deleted;
|
struct snapraid_deleted* deleted;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue