From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Date: Tue, 4 Nov 2014 20:26:43 +0100 Subject: [U-Boot] [PATCH v6 2/6] fs: interface changes to accomodate files greater than 2GB In-Reply-To: <1415069408-2978-3-git-send-email-suriyan.r@gmail.com> References: <1415069408-2978-1-git-send-email-suriyan.r@gmail.com> <1415069408-2978-3-git-send-email-suriyan.r@gmail.com> Message-ID: <20141104192641.GA13607@amd> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > > 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", > + " [ [ [ [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