]> Git Repo - linux.git/commitdiff
ubi: fastmap: Add control in 'UBI_IOCATT' ioctl to reserve PEBs for filling pools
authorZhihao Cheng <[email protected]>
Mon, 28 Aug 2023 06:38:45 +0000 (14:38 +0800)
committerRichard Weinberger <[email protected]>
Sat, 28 Oct 2023 21:16:00 +0000 (23:16 +0200)
This patch imports a new field 'need_resv_pool' in struct 'ubi_attach_req'
to control whether or not reserving free PEBs for filling pool/wl_pool.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217787
Signed-off-by: Zhihao Cheng <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
drivers/mtd/ubi/cdev.c
include/uapi/mtd/ubi-user.h

index 98aa00344b29bab91785ff684636936ba7034f7c..0d8f04cf03c5bbff04154ca30c62cd6c936cb648 100644 (file)
@@ -1042,7 +1042,7 @@ static long ctrl_cdev_ioctl(struct file *file, unsigned int cmd,
                mutex_lock(&ubi_devices_mutex);
                err = ubi_attach_mtd_dev(mtd, req.ubi_num, req.vid_hdr_offset,
                                         req.max_beb_per1024, !!req.disable_fm,
-                                        false);
+                                        !!req.need_resv_pool);
                mutex_unlock(&ubi_devices_mutex);
                if (err < 0)
                        put_mtd_device(mtd);
index dcb179de43585f74ad80fc8da96a66e73f5fdf99..e1571603175e715339cdfb4c0a4d09ddd3a9dfa0 100644 (file)
@@ -248,6 +248,7 @@ enum {
  * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
  * @padding: reserved for future, not used, has to be zeroed
  * @disable_fm: whether disable fastmap
+ * @need_resv_pool: whether reserve free pebs for filling pool/wl_pool
  *
  * This data structure is used to specify MTD device UBI has to attach and the
  * parameters it has to use. The number which should be assigned to the new UBI
@@ -293,7 +294,8 @@ struct ubi_attach_req {
        __s32 vid_hdr_offset;
        __s16 max_beb_per1024;
        __s8 disable_fm;
-       __s8 padding[9];
+       __s8 need_resv_pool;
+       __s8 padding[8];
 };
 
 /*
This page took 0.055163 seconds and 4 git commands to generate.