public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 2/6] fs: interface changes to accomodate files greater than 2GB
Date: Tue, 4 Nov 2014 20:26:43 +0100	[thread overview]
Message-ID: <20141104192641.GA13607@amd> (raw)
In-Reply-To: <1415069408-2978-3-git-send-email-suriyan.r@gmail.com>

On Mon 2014-11-03 18:49:58, Suriyan Ramasami wrote:
> Change the interface for the generic FS functions to take in an extra
> parameter of type "loff_t *" to return the size. The return values of
> these funtions now serve as an indicator of error conditions alone.
> 
> Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
> ---
> 
> Changes in v6:
> * Simon - Split this into a separate patch
> 
> Changes in v5:
> * Simon - update fs.h with comments for fs_read/fs_write/fs_size
> 
>  common/cmd_fs.c | 17 +++++++++++++
>  fs/fs.c         | 77 ++++++++++++++++++++++++++++++++++-----------------------
>  include/fs.h    | 41 ++++++++++++++++++------------
>  3 files changed, 88 insertions(+), 47 deletions(-)
> 
> diff --git a/common/cmd_fs.c b/common/cmd_fs.c
> index 6754340..f70cb8a 100644
> --- a/common/cmd_fs.c
> +++ b/common/cmd_fs.c
> @@ -51,6 +51,23 @@ U_BOOT_CMD(
>  	"      If 'pos' is 0 or omitted, the file is read from the start."
>  )
>  
> +static int do_save_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
> +				char * const argv[])
> +{
> +	return do_save(cmdtp, flag, argc, argv, FS_TYPE_ANY);
> +}
> +
> +U_BOOT_CMD(
> +	save,	7,	0,	do_save_wrapper,
> +	"save file to a filesystem",
> +	"<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"

That's not correct, AFAICT.

int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                int fstype)
{
	unsigned long addr;
	const char *filename;
        unsigned long bytes;
	unsigned long pos;
	int len;
        unsigned long time;

	if (argc < 6 || argc > 7)
                return CMD_RET_USAGE;

More arguments are mandatory then you describe here.

> +	"    - Save binary file 'filename' to partition 'part' on device\n"
> +	"      type 'interface' instance 'dev' from addr 'addr' in memory.\n"
> +	"      'bytes' gives the size to save in bytes and is mandatory.\n"
> +	"      'pos' gives the file byte position to start writing to.\n"
> +	"      If 'pos' is 0 or omitted, the file is written from the start."

Plus maybe note if it can extend existing files and create files if
they don't exit would be nice here?

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2014-11-04 19:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  2:49 [U-Boot] [PATCH v6 0/6] fs: fat/ext4/sandbox - Deal with files greater than 2GB Suriyan Ramasami
2014-11-04  2:49 ` [U-Boot] [PATCH v6 1/6] sandbox: script for testing sandbox/ext4/fat/fs commands Suriyan Ramasami
2014-11-05  1:04   ` Simon Glass
2014-11-05 22:02     ` Suriyan Ramasami
2014-11-04  2:49 ` [U-Boot] [PATCH v6 2/6] fs: interface changes to accomodate files greater than 2GB Suriyan Ramasami
2014-11-04 19:26   ` Pavel Machek [this message]
2014-11-04 21:39     ` Suriyan Ramasami
2014-11-05  0:49   ` Simon Glass
2014-11-04  2:49 ` [U-Boot] [PATCH v6 3/6] fat: " Suriyan Ramasami
2014-11-04  2:50 ` [U-Boot] [PATCH v6 4/6] ext4: " Suriyan Ramasami
2014-11-04  2:50 ` [U-Boot] [PATCH v6 5/6] sandbox: Use md5sum and fatwrite to enable testing of fs commands Suriyan Ramasami
2014-11-05  1:05   ` Simon Glass
2014-11-04  2:50 ` [U-Boot] [PATCH v6 6/6] sandbox: interface changes to accomodate files greater than 2GB Suriyan Ramasami
2014-11-04  6:26 ` [U-Boot] [PATCH v6 0/6] fs: fat/ext4/sandbox - Deal with " Simon Glass
2014-11-04 15:06   ` Suriyan Ramasami

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=20141104192641.GA13607@amd \
    --to=pavel@denx.de \
    --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