diff options
| author | Alexey Romanov <[email protected]> | 2024-07-18 08:45:23 +0300 |
|---|---|---|
| committer | Michael Trimarchi <[email protected]> | 2024-08-08 09:27:55 +0200 |
| commit | cead69c528d4f107288717aeca6af52d0d9d47e9 (patch) | |
| tree | 2fe5d8441951b5fff016ebe063edcfbbf6e7ccf3 /cmd | |
| parent | d12689af6c6d12f1c49d988e6c418afbbd9b82c5 (diff) | |
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 <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]>
Acked-by: Heiko Schocher <[email protected]>
Signed-off-by: Michael Trimarchi <[email protected]>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/ubi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/ubi.c b/cmd/ubi.c index 92998af2b02..4bf7c099dde 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -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); } } |
