Optimizing Massive Directory Traversal on Portable Flash Storage Via Continuity-Aware Dynamic Read-Ahead
Abstract
Portable flash devices, such as TF cards, widely adopt the exFAT file system due to its cross-platform compatibility and support for large-capacity storage. However, directory entries in exFAT exhibit a distributed storage characteristic. When traversing files within massive small directories, a single read request for a tiny directory entry triggers a large-window readahead operation based on physical address alignment. This overprefetching leads to excessive invalid data reading and storage resource waste, significantly increasing the latency of directory traversal. To address this issue, this paper proposes a continuityaware dynamic read-ahead scheme. Without altering the file system layout, the proposed scheme dynamically adjusts the readahead window by recording the continuity status of historical access sectors in memory. Experimental results demonstrate that this strategy substantially improves the traversal efficiency of massive small directories with negligible overhead, while simultaneously maintaining high sequential read performance for large directories.