aboutsummaryrefslogtreecommitdiff
path: root/include/libubi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libubi.h')
-rw-r--r--include/libubi.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/libubi.h b/include/libubi.h
index 8ea11e0..b5b3d8f 100644
--- a/include/libubi.h
+++ b/include/libubi.h
@@ -55,6 +55,7 @@ typedef void * libubi_t;
* most of the users want)
* @max_beb_per1024: Maximum expected bad eraseblocks per 1024 eraseblocks
* @disable_fm: whether disable fastmap
+ * @need_resv_pool: whether reserve free pebs for filling pool/wl_pool
*/
struct ubi_attach_request
{
@@ -64,6 +65,7 @@ struct ubi_attach_request
int vid_hdr_offset;
int max_beb_per1024;
bool disable_fm;
+ bool need_resv_pool;
};
/**
@@ -429,8 +431,8 @@ int ubi_vol_block_remove(int fd);
* @bytes: how many bytes will be written to the volume
*
* This function initiates UBI volume update and returns %0 in case of success
- * and %-1 in case of error. The caller is assumed to write @bytes data to the
- * volume @fd afterward.
+ * and %-1 in case of error (errno is set). The caller is assumed to write
+ * @bytes data to the volume @fd afterward.
*/
int ubi_update_start(libubi_t desc, int fd, long long bytes);
@@ -485,6 +487,21 @@ int ubi_leb_unmap(int fd, int lnum);
*/
int ubi_is_mapped(int fd, int lnum);
+/**
+ * ubi_leb_map - map logical eraseblock to a physical eraseblock.
+ * @fd: volume character device file descriptor
+ * @lnum: logical eraseblock number
+ *
+ * This function maps an un-mapped logical eraseblock @lnum to a physical
+ * eraseblock. This means, that after a successful invocation of this
+ * function the logical eraseblock @lnum will be empty (contain only %0xFF
+ * bytes) and be mapped to a physical eraseblock, even if an unclean reboot
+ * happens.
+ *
+ * This function returns zero in case of success, %-1 in case of failures.
+ */
+int ubi_leb_map(int fd, int lnum);
+
#ifdef __cplusplus
}
#endif