mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
Merge git://git.denx.de/u-boot-ubi
This commit is contained in:
commit
1c7b5d0309
1 changed files with 5 additions and 0 deletions
|
@ -334,6 +334,7 @@ int ubi_volume_read(char *volume, char *buf, size_t size)
|
|||
unsigned long long tmp;
|
||||
struct ubi_volume *vol;
|
||||
loff_t offp = 0;
|
||||
size_t len_read;
|
||||
|
||||
vol = ubi_find_volume(volume);
|
||||
if (vol == NULL)
|
||||
|
@ -373,6 +374,7 @@ int ubi_volume_read(char *volume, char *buf, size_t size)
|
|||
tmp = offp;
|
||||
off = do_div(tmp, vol->usable_leb_size);
|
||||
lnum = tmp;
|
||||
len_read = size;
|
||||
do {
|
||||
if (off + len >= vol->usable_leb_size)
|
||||
len = vol->usable_leb_size - off;
|
||||
|
@ -398,6 +400,9 @@ int ubi_volume_read(char *volume, char *buf, size_t size)
|
|||
len = size > tbuf_size ? tbuf_size : size;
|
||||
} while (size);
|
||||
|
||||
if (!size)
|
||||
env_set_hex("filesize", len_read);
|
||||
|
||||
free(tbuf);
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue