diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2016-05-13 14:19:08 +0200 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-07-25 14:39:49 +0900 |
commit | 8b19dd2c0ae925b0692ecb73b2f912ec65a6dd82 (patch) | |
tree | 828db4c55a9e48cdb921fe0a1dbe79e338b36e66 /libthor/thor_raw_file.c | |
parent | 40175b01581831beff844c7bebe3fe3b8bf51cc4 (diff) | |
download | lthor-8b19dd2c0ae925b0692ecb73b2f912ec65a6dd82.tar.gz lthor-8b19dd2c0ae925b0692ecb73b2f912ec65a6dd82.tar.bz2 lthor-8b19dd2c0ae925b0692ecb73b2f912ec65a6dd82.zip |
Add support for large files
Currently session size is send over USB as integer 32b.
So max size of all files is 2GB.
Some fixed uboot versions treat this value as unsigned integer 32b.
So there max size of all files is 4GB.
Let's provide initial support for large files in lthor by
counting all size using off_t which thanks to define is 64b
on all platforms.
This patch also add a suitable warning if image is larger than
2GB and reports an error if image is larger than 4GB.
Change-Id: I402b3684fa96c7531edb580e38f109ecc8a5ebd0
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'libthor/thor_raw_file.c')
-rw-r--r-- | libthor/thor_raw_file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libthor/thor_raw_file.c b/libthor/thor_raw_file.c index 1ec1385..d4177bb 100644 --- a/libthor/thor_raw_file.c +++ b/libthor/thor_raw_file.c @@ -31,11 +31,11 @@ struct file_data_src { struct thor_data_src src; int fd; const char* filename; - size_t filesize; + off_t filesize; int pos; }; -static size_t file_get_file_length(struct thor_data_src *src) +static off_t file_get_file_length(struct thor_data_src *src) { struct file_data_src *filedata = container_of(src, struct file_data_src, src); @@ -43,8 +43,8 @@ static size_t file_get_file_length(struct thor_data_src *src) return filedata->filesize; } -static size_t file_get_data_block(struct thor_data_src *src, - void *data, size_t len) +static off_t file_get_data_block(struct thor_data_src *src, + void *data, off_t len) { struct file_data_src *filedata = container_of(src, struct file_data_src, src); |