mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Add mutex protection at the filesystem structure
In sync we need to modify the filesystem, like to call fs_deallocate(). We need then proper protection. This also removes the need of multiple fs_last cached value.
This commit is contained in:
parent
74204a42d7
commit
cbf2040b89
8 changed files with 117 additions and 91 deletions
|
|
@ -481,7 +481,7 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
|||
}
|
||||
|
||||
/* get the block */
|
||||
task->block = fs_par2block_get_ts(disk, &worker->fs_last, blockcur);
|
||||
task->block = fs_par2block_get(disk, blockcur);
|
||||
|
||||
/* if the block has no file, meanining that it's EMPTY or DELETED, */
|
||||
/* it doesn't partecipate in the new parity computation */
|
||||
|
|
@ -493,7 +493,7 @@ static void sync_data_reader(struct snapraid_worker* worker, struct snapraid_tas
|
|||
}
|
||||
|
||||
/* get the file of this block */
|
||||
task->file = fs_par2file_get_ts(disk, &worker->fs_last, blockcur, &task->file_pos);
|
||||
task->file = fs_par2file_get(disk, blockcur, &task->file_pos);
|
||||
|
||||
/* if the file is different than the current one, close it */
|
||||
if (handle->file != 0 && handle->file != task->file) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue