mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 04:46:46 -05:00
Exclude snapshot directory only when snapshot mode is enabled
This commit is contained in:
parent
a8a94bb950
commit
3e71e68848
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;
|
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)
|
if (*sub == 0 && pathcmp(name, SNAPSHOT_CONTAINER) == 0)
|
||||||
return -1;
|
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
|
* Filter a path that is in a snapshot
|
||||||
* Return !=0 if should be excluded.
|
* 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.
|
* 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() */
|
/* 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);
|
msg_verbose("Excluding snapshots directory '%s'\n", path_next);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ static void search_dir(struct snapraid_state* state, struct snapraid_disk* disk,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* exclude snapshot container even before calling lstat() */
|
/* 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);
|
msg_verbose("Excluding snapshots directory '%s'\n", path_next);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue