1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

ubi: allow to read from volume with offset

Now user can pass an additional parameter 'offset'
to ubi_volume_read() function.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
This commit is contained in:
Alexey Romanov
2024-07-18 08:45:23 +03:00
committed by Michael Trimarchi
parent d12689af6c
commit cead69c528
3 changed files with 7 additions and 7 deletions

View File

@@ -428,13 +428,13 @@ int ubi_volume_write(char *volume, void *buf, size_t size)
return ubi_volume_begin_write(volume, buf, size, size);
}
int ubi_volume_read(char *volume, char *buf, size_t size)
int ubi_volume_read(char *volume, char *buf, loff_t offset, size_t size)
{
int err, lnum, off, len, tbuf_size;
void *tbuf;
unsigned long long tmp;
struct ubi_volume *vol;
loff_t offp = 0;
loff_t offp = offset;
size_t len_read;
vol = ubi_find_volume(volume);
@@ -795,7 +795,7 @@ static int do_ubi(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
}
if (argc == 3) {
return ubi_volume_read(argv[3], (char *)addr, size);
return ubi_volume_read(argv[3], (char *)addr, 0, size);
}
}