mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Exclude snapshot directory only when snapshot mode is enabled
This commit is contained in:
parent
daf713820e
commit
30417d57a5
4 changed files with 7 additions and 4 deletions
|
|
@ -389,8 +389,11 @@ int filter_content(tommy_list* contentlist, const char* mount_point, size_t moun
|
|||
return 0;
|
||||
}
|
||||
|
||||
int filter_snapshot(const char* sub, const char* name)
|
||||
int filter_snapshot(int enable, const char* sub, const char* name)
|
||||
{
|
||||
if (!enable)
|
||||
return 0;
|
||||
|
||||
if (*sub == 0 && pathcmp(name, SNAPSHOT_CONTAINER) == 0)
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ int filter_content(tommy_list* contentlist, const char* mount_point, size_t moun
|
|||
* Filter a path that is in a snapshot
|
||||
* Return !=0 if should be excluded.
|
||||
*/
|
||||
int filter_snapshot(const char* sub, const char* name);
|
||||
int filter_snapshot(int enable, const char* sub, const char* name);
|
||||
|
||||
/**
|
||||
* Check if the specified hash is invalid.
|
||||
|
|
|
|||
|
|
@ -1437,7 +1437,7 @@ static int scan_sub(struct snapraid_scan* scan, int level, int is_diff, char* pa
|
|||
}
|
||||
|
||||
/* exclude snapshot container even before calling lstat() */
|
||||
if (filter_snapshot(sub_next, name) != 0) {
|
||||
if (filter_snapshot(state->snapshot, sub_next, name) != 0) {
|
||||
msg_verbose("Excluding snapshots directory '%s'\n", path_next);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ static void search_dir(struct snapraid_state* state, struct snapraid_disk* disk,
|
|||
}
|
||||
|
||||
/* exclude snapshot container even before calling lstat() */
|
||||
if (disk != 0 && filter_snapshot(sub, name) != 0) {
|
||||
if (disk != 0 && filter_snapshot(state->snapshot, sub, name) != 0) {
|
||||
msg_verbose("Excluding snapshots directory '%s'\n", path_next);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue