dfs_fs.c: optimized redundant loop.