diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2024-10-26 08:40:48 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-11-01 13:37:58 -0600 |
commit | 29e5a2e9597234700420e8e93055861eba3b409c (patch) | |
tree | 8d2eb95a4ddfd7ef3ca48d4a95a15fdfb78f8a2e /fs/ext4/ext4fs.c | |
parent | 8b1d6fcc9082c9eea590408e4675c45671107cd7 (diff) |
fs: ext4: use fs_ls_generic
Now that opendir, readir, closedir are implemented for ext4 we can use
fs_ls_generic() for implementing the ls command.
Adjust the unit tests:
* fs_ls_generic() produces more spaces between file size and name.
* The ext4 specific message "** Can not find directory. **\n" is not
written anymore.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'fs/ext4/ext4fs.c')
-rw-r--r-- | fs/ext4/ext4fs.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c index 32693198aeb..dfecfa0b4e8 100644 --- a/fs/ext4/ext4fs.c +++ b/fs/ext4/ext4fs.c @@ -201,29 +201,6 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos, return 0; } -int ext4fs_ls(const char *dirname) -{ - struct ext2fs_node *dirnode = NULL; - int status; - - if (dirname == NULL) - return 0; - - status = ext4fs_find_file(dirname, &ext4fs_root->diropen, &dirnode, - FILETYPE_DIRECTORY); - if (status != 1) { - printf("** Can not find directory. **\n"); - if (dirnode) - ext4fs_free_node(dirnode, &ext4fs_root->diropen); - return 1; - } - - ext4fs_iterate_dir(dirnode, NULL, NULL, NULL); - ext4fs_free_node(dirnode, &ext4fs_root->diropen); - - return 0; -} - int ext4fs_opendir(const char *dirname, struct fs_dir_stream **dirsp) { struct ext4_dir_stream *dirs; |