diff options
author | Suriyan Ramasami <suriyan.r@gmail.com> | 2014-11-17 14:39:35 -0800 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-11-23 06:49:04 -0500 |
commit | 1ad0b98a067a133c0e8a182649a76a4afd739594 (patch) | |
tree | 26f5ce4468fb8886efee020e31257f62c5feaca4 /common/cmd_fat.c | |
parent | 64553717bb3552f736090298ea952cb5ef07ef75 (diff) |
fat: Prepare API change for files greater than 2GB
Change the internal FAT functions to use loff_t for offsets.
Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Fix fs/fat/fat.c for min3 updates]
Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'common/cmd_fat.c')
-rw-r--r-- | common/cmd_fat.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/common/cmd_fat.c b/common/cmd_fat.c index 633fbf1d311..c00fb28b620 100644 --- a/common/cmd_fat.c +++ b/common/cmd_fat.c @@ -100,7 +100,8 @@ U_BOOT_CMD( static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - long size; + loff_t size; + int ret; unsigned long addr; unsigned long count; block_dev_desc_t *dev_desc = NULL; @@ -127,15 +128,15 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag, count = simple_strtoul(argv[5], NULL, 16); buf = map_sysmem(addr, count); - size = file_fat_write(argv[4], buf, count); + ret = file_fat_write(argv[4], buf, 0, count, &size); unmap_sysmem(buf); - if (size == -1) { + if (ret < 0) { printf("\n** Unable to write \"%s\" from %s %d:%d **\n", argv[4], argv[1], dev, part); return 1; } - printf("%ld bytes written\n", size); + printf("%llu bytes written\n", size); return 0; } |