aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZhihao Cheng <chengzhihao1@huawei.com>2023-11-13 17:48:11 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-11-20 07:43:30 +0100
commitb4b45994a9ba02d575625e3b1076c337be7d4861 (patch)
treebf7c3baa93f77236d33b4369523583af911fd7dc /include
parent71edfe3b5a51ea9a7fac9760804db328ea1ec8a0 (diff)
ubiattach: introduce disable_fm in UBI_IOCATT
The ioctl UBI_IOCATT has been extended with disable_fm parameter after [1]. This parameter is used for disabling fastmap for target ubi device. If 'disable_fm' is set, ubi doesn't create new fastmap even the module param 'fm_autoconvert' is set, and existed old fastmap will be destroyed after attaching process. A simple test case in [2]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=669d204469c46e91d99da24914130f78277a71d3 [2] https://bugzilla.kernel.org/show_bug.cgi?id=216278 Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/libubi.h3
-rw-r--r--include/mtd/ubi-user.h8
2 files changed, 10 insertions, 1 deletions
diff --git a/include/libubi.h b/include/libubi.h
index 46c732a..8ea11e0 100644
--- a/include/libubi.h
+++ b/include/libubi.h
@@ -25,6 +25,7 @@
#include <ctype.h>
#include <stdint.h>
+#include <stdbool.h>
#include <mtd/ubi-user.h>
#ifdef __cplusplus
@@ -53,6 +54,7 @@ typedef void * libubi_t;
* @vid_hdr_offset: VID header offset (%0 means default offset and this is what
* most of the users want)
* @max_beb_per1024: Maximum expected bad eraseblocks per 1024 eraseblocks
+ * @disable_fm: whether disable fastmap
*/
struct ubi_attach_request
{
@@ -61,6 +63,7 @@ struct ubi_attach_request
const char *mtd_dev_node;
int vid_hdr_offset;
int max_beb_per1024;
+ bool disable_fm;
};
/**
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index 707c4f2..a389693 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -235,6 +235,7 @@ enum {
* @mtd_num: MTD device number to attach
* @vid_hdr_offset: VID header offset (use defaults if %0)
* @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
+ * @disable_fm: whether disable fastmap
* @padding: reserved for future, not used, has to be zeroed
*
* This data structure is used to specify MTD device UBI has to attach and the
@@ -270,13 +271,18 @@ enum {
* eraseblocks for new bad eraseblocks, but attempts to use available
* eraseblocks (if any). The accepted range is 0-768. If 0 is given, the
* default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used.
+ *
+ * If @disable_fm is not zero, ubi doesn't create new fastmap even the module
+ * param 'fm_autoconvert' is set, and existed old fastmap will be destroyed
+ * after doing full scanning.
*/
struct ubi_attach_req {
int32_t ubi_num;
int32_t mtd_num;
int32_t vid_hdr_offset;
int16_t max_beb_per1024;
- int8_t padding[10];
+ int8_t disable_fm;
+ int8_t padding[9];
};
/*