mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-29 19:37:06 -05:00
Avoid redundant block initialization when loading content files
This commit is contained in:
parent
bc564e7465
commit
b14f703d2b
4 changed files with 22 additions and 10 deletions
|
|
@ -472,7 +472,6 @@ int filter_snapshot(int enable, const char* sub, const char* name)
|
|||
struct snapraid_file* file_alloc(unsigned block_size, const char* sub, data_off_t size, uint64_t mtime_sec, int mtime_nsec, uint64_t inode)
|
||||
{
|
||||
struct snapraid_file* file;
|
||||
block_off_t i;
|
||||
block_off_t blockmax;
|
||||
|
||||
blockmax = size / block_size;
|
||||
|
|
@ -498,12 +497,6 @@ struct snapraid_file* file_alloc(unsigned block_size, const char* sub, data_off_
|
|||
file->flag = 0;
|
||||
file->blockvec = nalloc_nofail((size_t)file->blockmax, block_sizeof());
|
||||
|
||||
for (i = 0; i < file->blockmax; ++i) {
|
||||
struct snapraid_block* block = file_block(file, i);
|
||||
block_state_set(block, BLOCK_STATE_CHG);
|
||||
hash_invalid_set(block->hash);
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue