use dir to replace f in romfs_opendir for clean code