Merge all 5 PRs: security, CLI features, protocol, performance, tests/docs
CI / lint (pull_request) Failing after 11s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped

This commit is contained in:
2026-07-21 18:01:02 +02:00
parent 3b5d89fdb9
commit 415adf2077
9 changed files with 53 additions and 33 deletions
+5 -2
View File
@@ -215,6 +215,7 @@ typedef struct {
int include_count;
unsigned long long max_size;
unsigned long long min_size;
int max_depth;
} ParallelWorkerArg;
static int parallel_worker_thread(void* arg) {
@@ -222,7 +223,7 @@ static int parallel_worker_thread(void* arg) {
for (int i = 0; i < wa->dir_count; i++) {
DirectoryScanner* ds = directory_scanner_create(
wa->dirs[i], wa->use_metadata, wa->chunk_size, wa->exclude_patterns, wa->exclude_count,
wa->include_patterns, wa->include_count, wa->max_size, wa->min_size);
wa->include_patterns, wa->include_count, wa->max_size, wa->min_size, wa->max_depth);
Chunk* chunk;
while ((chunk = directory_scanner_next(ds)) != NULL) {
queue_enqueue_multithreaded(wa->ps->result_queue, chunk, &wa->ps->result_mutex,
@@ -248,7 +249,8 @@ ParallelScanner* parallel_scanner_create(char* root_directory, bool use_metadata
unsigned long long chunk_size, char** exclude_patterns,
int exclude_count, char** include_patterns,
int include_count, unsigned long long max_size,
unsigned long long min_size, int num_threads) {
unsigned long long min_size, int max_depth,
int num_threads) {
ParallelScanner* ps = calloc(1, sizeof(ParallelScanner));
if (!ps)
return NULL;
@@ -406,6 +408,7 @@ ParallelScanner* parallel_scanner_create(char* root_directory, bool use_metadata
wa->include_count = include_count;
wa->max_size = max_size;
wa->min_size = min_size;
wa->max_depth = max_depth;
start += count;
if (thrd_create(&ps->threads[t], parallel_worker_thread, wa) != thrd_success) {
for (int j = 0; j < count; j++)