summaryrefslogtreecommitdiff
path: root/ubi-utils
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-05-08 18:50:25 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-05-08 19:07:26 +0300
commit954491b96b6c06f2e8f870434b7e420c3e8c32dd (patch)
tree75f65674c0bad3b2f6a06af4feaf3d7b39532780 /ubi-utils
parent773d4c51ed414e01be701f3378cf9db486291a26 (diff)
libubi: add ubi_leb_unmap interface
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils')
-rw-r--r--ubi-utils/include/libubi.h10
-rw-r--r--ubi-utils/src/libubi.c5
2 files changed, 15 insertions, 0 deletions
diff --git a/ubi-utils/include/libubi.h b/ubi-utils/include/libubi.h
index 243bcbb..4ffe1e8 100644
--- a/ubi-utils/include/libubi.h
+++ b/ubi-utils/include/libubi.h
@@ -404,6 +404,16 @@ int ubi_leb_change_start(libubi_t desc, int fd, int lnum, int bytes, int dtype);
*/
int ubi_set_property(int fd, uint8_t property, uint64_t value);
+/**
+ * ubi_leb_unmap - unmap a logical eraseblock.
+ * @fd: volume character device file descriptor
+ * @lnum: logical eraseblock to unmap
+ *
+ * This function unmaps LEB @lnum and returns zero in case of success and a
+ * negative error code in case of error.
+ */
+int ubi_leb_unmap(int fd, int lnum);
+
#ifdef __cplusplus
}
#endif
diff --git a/ubi-utils/src/libubi.c b/ubi-utils/src/libubi.c
index c63beeb..5c8ce9e 100644
--- a/ubi-utils/src/libubi.c
+++ b/ubi-utils/src/libubi.c
@@ -1250,3 +1250,8 @@ int ubi_set_property(int fd, uint8_t property, uint64_t value)
return ioctl(fd, UBI_IOCSETPROP, &r);
}
+
+int ubi_leb_unmap(int fd, int lnum)
+{
+ return ioctl(fd, UBI_IOCEBUNMAP, &lnum);
+}