diff options
author | Zhihao Cheng <chengzhihao1@huawei.com> | 2024-11-11 16:36:53 +0800 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2024-11-11 10:32:45 +0100 |
commit | d539a3951fc5eba852b1fd79e151e1879611a5df (patch) | |
tree | 5d822202ea3e5e6783cb789efe5f9f924946fd86 /lib/libubi.c | |
parent | 008d2cad386862ce0f0abb20df291a3d29313b96 (diff) |
libubi: Add new interface ubi_leb_map()
Add ubi_leb_map() implementation, it is used in UBIFS linux kernel libs.
This is a preparation for replacing implementation of UBIFS utils with
linux kernel libs.
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/libubi.c')
-rw-r--r-- | lib/libubi.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libubi.c b/lib/libubi.c index 6b57e50..86736dd 100644 --- a/lib/libubi.c +++ b/lib/libubi.c @@ -1364,3 +1364,13 @@ int ubi_is_mapped(int fd, int lnum) { return ioctl(fd, UBI_IOCEBISMAP, &lnum); } + +int ubi_leb_map(int fd, int lnum) +{ + struct ubi_map_req r; + + memset(&r, 0, sizeof(struct ubi_map_req)); + r.lnum = lnum; + + return ioctl(fd, UBI_IOCEBMAP, &r); +} |