mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
fat/fs: move ls to generic implementation
Add a generic implementation of 'ls' using opendir/readdir/closedir, and replace fat's custom implementation. Other filesystems should move to the generic implementation after they add opendir/readdir/closedir support. Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Łukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#define _FAT_H_
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#include <fs.h>
|
||||
|
||||
#define CONFIG_SUPPORT_VFAT
|
||||
/* Maximum Long File Name length supported here is 128 UTF-16 code units */
|
||||
@ -179,7 +180,6 @@ static inline u32 clust_to_sect(fsdata *fsdata, u32 clust)
|
||||
}
|
||||
|
||||
int file_fat_detectfs(void);
|
||||
int file_fat_ls(const char *dir);
|
||||
int fat_exists(const char *filename);
|
||||
int fat_size(const char *filename, loff_t *size);
|
||||
int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
@ -192,5 +192,8 @@ int file_fat_write(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
loff_t *actwrite);
|
||||
int fat_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
|
||||
loff_t *actread);
|
||||
int fat_opendir(const char *filename, struct fs_dir_stream **dirsp);
|
||||
int fat_readdir(struct fs_dir_stream *dirs, struct fs_dirent **dentp);
|
||||
void fat_closedir(struct fs_dir_stream *dirs);
|
||||
void fat_close(void);
|
||||
#endif /* _FAT_H_ */
|
||||
|
Reference in New Issue
Block a user