diff options
author | Rob Clark <robdclark@gmail.com> | 2017-09-09 13:15:58 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-09-15 09:03:13 -0400 |
commit | 89191d626793490b579e1d36e7d7a4464a20f9f6 (patch) | |
tree | d4e236f4727d390695f844a063619c5c418584dd /fs/fat | |
parent | 41fa83d1a6cdd8ddfb3fbe332252193ff8fb8b71 (diff) | |
download | u-boot-89191d626793490b579e1d36e7d7a4464a20f9f6.zip u-boot-89191d626793490b579e1d36e7d7a4464a20f9f6.tar.gz u-boot-89191d626793490b579e1d36e7d7a4464a20f9f6.tar.bz2 |
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>
Diffstat (limited to 'fs/fat')
-rw-r--r-- | fs/fat/fat.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 82ddb7e..c951d84 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -1029,38 +1029,6 @@ int file_fat_detectfs(void) return 0; } -int file_fat_ls(const char *dir) -{ - fsdata fsdata; - fat_itr itrblock, *itr = &itrblock; - int files = 0, dirs = 0; - int ret; - - ret = fat_itr_root(itr, &fsdata); - if (ret) - return ret; - - ret = fat_itr_resolve(itr, dir, TYPE_DIR); - if (ret) - return ret; - - while (fat_itr_next(itr)) { - if (fat_itr_isdir(itr)) { - printf(" %s/\n", itr->name); - dirs++; - } else { - printf(" %8u %s\n", - FAT2CPU32(itr->dent->size), - itr->name); - files++; - } - } - - printf("\n%d file(s), %d dir(s)\n\n", files, dirs); - - return 0; -} - int fat_exists(const char *filename) { fsdata fsdata; |