From e3cc4f8216e36bd9defff0db22504d4d8f75a03b Mon Sep 17 00:00:00 2001 From: Lei Feng Date: Wed, 21 Apr 2021 09:30:59 +0800 Subject: [PATCH] EX-3051 lipe: posix scan in DFS way In lipe posix scan function, there is a queue to save directories to be scanned. If we put the new entries into the tail and get entries from the head, it's an approximate Breadth-First-Search. But if we put the new entries into the head and get entries from the head too, it's an approximate Depth-First-Search. DFS is better to save memory of queue and can get file ASAP. Change-Id: Ief32cf9cea42ba35c90084ee500a0801cc8396aa Signed-off-by: Lei Feng Test-Parameters: trivial Reviewed-on: https://review.whamcloud.com/43381 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Li Xi --- lipe/src/posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lipe/src/posix.c b/lipe/src/posix.c index 322ade1..a72cdab 100644 --- a/lipe/src/posix.c +++ b/lipe/src/posix.c @@ -105,7 +105,7 @@ static int posix_scan_offload_work(struct global_info *ginfo, if (ginfo->gi_work_number <= ginfo->gi_num_threads) posix_scan_add_global_work(ginfo, work); else - lipe_list_add_tail(&work->psw_linkage, local_queue); + lipe_list_add(&work->psw_linkage, local_queue); return 0; } -- 1.8.3.1