Whamcloud - gitweb
EX-3051 lipe: posix scan in DFS way
authorLei Feng <flei@whamcloud.com>
Wed, 21 Apr 2021 01:30:59 +0000 (09:30 +0800)
committerLi Xi <lixi@ddn.com>
Sun, 1 Aug 2021 02:02:31 +0000 (02:02 +0000)
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 <flei@whamcloud.com>
Test-Parameters: trivial
Reviewed-on: https://review.whamcloud.com/43381
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
lipe/src/posix.c

index 322ade1..a72cdab 100644 (file)
@@ -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;
 }