aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRan Hongyun <ranhongyun1@huawei.com>2026-07-23 10:37:06 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2026-08-03 07:42:07 +0200
commit76641773be73141652c6be5c45f53c91efd144e4 (patch)
tree7839e77069f3b22136cb6d136ad4e7ada15a0f37 /include
parentd1f2d1270c15e373c4e4b5bfbe0a83c7bcf6e793 (diff)
ubi-utils: add wear-leveling threshold parameter to ubiattachHEADmaster
Add wl_threshold support end-to-end: expose the kernel's wear-leveling threshold via a new --wl-threshold / -w option in ubiattach, plumb it through libubi, and define it by replacing 4 bytes of padding in struct ubi_attach_req. Valid range is 2-65536; 0 means use the kernel default. Signed-off-by: Ran Hongyun <ranhongyun1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/libubi.h2
-rw-r--r--include/mtd/ubi-user.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/include/libubi.h b/include/libubi.h
index b5b3d8f..9203416 100644
--- a/include/libubi.h
+++ b/include/libubi.h
@@ -56,6 +56,7 @@ typedef void * libubi_t;
* @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
+ * @wl_threshold: wear-leveling threshold (0 means use kernel default)
*/
struct ubi_attach_request
{
@@ -66,6 +67,7 @@ struct ubi_attach_request
int max_beb_per1024;
bool disable_fm;
bool need_resv_pool;
+ int wl_threshold;
};
/**
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index bb5c0f9..601f3f4 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -284,7 +284,8 @@ struct ubi_attach_req {
int16_t max_beb_per1024;
int8_t disable_fm;
int8_t need_resv_pool;
- int8_t padding[8];
+ int32_t wl_threshold;
+ int8_t padding[4];
};
/*