From: Rob Herring <robherring2@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3 3/3] fs: add filesystem switch libary, implement ls and fsload commands
Date: Sat, 20 Oct 2012 08:50:53 -0500 [thread overview]
Message-ID: <5082AC3D.2090108@gmail.com> (raw)
In-Reply-To: <1350684676-6110-3-git-send-email-swarren@wwwdotorg.org>
On 10/19/2012 05:11 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Implement "ls" and "fsload" commands that act like {fat,ext2}{ls,load},
> and transparently handle either file-system. This scheme could easily be
> extended to other filesystem types; I only didn't do it for zfs because
> I don't have any filesystems of that type to test with.
>
> Replace the implementation of {fat,ext[24]}{ls,load} with this new code
> too.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> v3:
> * Updated the implementation of the new commands to be suitable for use
> as the body of {fat,ext[24]}{ls,load} too.
> * Enhanced the implementation to make more fsload parameters optional
> (load address, filename); they can now come from environment variables
> like ext2load supported.
> * Moved implementation into fs.c.
> * Removed cmd_ext_common.c.
> * s/partition/filesystem/ in patch subject.
> v2:
> * Build cmd_fs.c when CONFIG_CMD_FS_GENERIC not always.
> * Use new CONFIG_FS_{FAT,EXT4} rather than CONFIG_CMD_{FAT,EXT2}.
> * Implemented fs_close() and call it from the tail of fs_ls() and fs_read().
> This ensures that any other usage of e.g. the ext4 library between fs_*()
> calls, then the two usages won't interfere.
> * Re-organized fs.c to reduce the number of ifdef blocks.
> * Added argc checking to do_ls().
> ---
> Makefile | 3 +-
> common/Makefile | 6 +-
> common/cmd_ext2.c | 13 +--
> common/cmd_ext4.c | 12 +--
> common/cmd_ext_common.c | 197 -------------------------------
> common/cmd_fat.c | 76 +------------
> common/cmd_fs.c | 51 ++++++++
> fs/Makefile | 47 ++++++++
> fs/fs.c | 298 +++++++++++++++++++++++++++++++++++++++++++++++
> include/ext_common.h | 3 -
> include/fs.h | 65 ++++++++++
> 11 files changed, 473 insertions(+), 298 deletions(-)
Now, I like the diffstat...
> +#define FS_TYPE_INVALID 0
> +#define FS_TYPE_FAT 1
> +#define FS_TYPE_EXT 2
> +#define FS_FAT (1 << 0)
> +#define FS_EXT (1 << 1)
> +#define FS_ANY 0xffffffff
Seems like these should be combined. I would go with the first one. I
think either you specify a single fs or you probe it. Plus we might want
to support more than 32 filesystems someday. ;)
Rob
prev parent reply other threads:[~2012-10-20 13:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-19 22:11 [U-Boot] [PATCH V3 1/3] fs: delete unused Makefile Stephen Warren
2012-10-19 22:11 ` [U-Boot] [PATCH V3 2/3] fs: separate CONFIG_FS_{FAT, EXT4} from CONFIG_CMD_{FAT, EXT*} Stephen Warren
2012-10-19 22:11 ` [U-Boot] [PATCH V3 3/3] fs: add filesystem switch libary, implement ls and fsload commands Stephen Warren
2012-10-20 13:50 ` Rob Herring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5082AC3D.2090108@gmail.com \
--to=robherring2@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox