The invention discloses a dynamic pre-reading method for massive small directories in portable
flash memory equipment, and belongs to the technical field of
storage management of computer operating systems. Aiming at the problems of excessive invalid I / O (Input / Output) and overlong traversal time consumption caused by scattered storage of
directory entries and preread aggressive of the portable
flash memory equipment in a scene of traversing massive small directories, the invention provides a dynamic preread method, and by maintaining a preread prompt structure in a memory, when a
directory entry read request is processed, the read request of the
directory entries is processed, and the read request of the directory entries is read. Judging whether the current access sector and the
historical record meet a continuity condition or not; if the continuity is satisfied, dynamically increasing the size of the pre-reading window to reward the
sequential access; and if the access is not satisfied or the access is the first time, dynamically reducing the pre-reading window. According to the method, on the premise of not changing the disk
layout of the
file system, by optimizing the pre-reading strategy in the memory, invalid I / O operation is reduced, the traversal efficiency of massive small directories is improved by several times, and meanwhile, the sequential reading performance of large directories is considered.