[LU-14380] Make statahead better support Breadth First Search (BFS) or Depth First Search (DFS) Created: 28/Jan/21 Updated: 05/Nov/22 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Qian Yingjin | Assignee: | Qian Yingjin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||||||
| Description |
|
Batching processing can obtain boost performance.
BFS_Traverse(DIR, Q) {
Q.enqueue(DIR);
while |Q| > 0 do
dir = Q.dequeue()
opendir(dir);
while dent = readdir(dir) != NULL do
stat(dent); process(dent);
if dent is a directory do
Q.enqueue(dent);
end if
end while
closedir(dir);
end while
}
DFS_Traverse(dir) {
openddir(dir);
while (dent = readdir(dir) != NULL) do
if dent is a file then
stat(dent); process(dent);
else /* a directory */
DFS_Traverse(dent)
end if
end while
closedir(dir);
}
|
| Comments |
| Comment by Gerrit Updater [ 05/Feb/21 ] |
|
Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/41422 |
| Comment by Gerrit Updater [ 19/Feb/21 ] |
|
Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/41692 |
| Comment by Gerrit Updater [ 20/Mar/21 ] |
|
Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/42115 |
| Comment by Gerrit Updater [ 30/Mar/21 ] |
|
Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/43170 |