Skip to content

Commit ac085cf

Browse files
Zhihao Chengrichardweinberger
authored andcommitted
ubi: fastmap: Add control in 'UBI_IOCATT' ioctl to reserve PEBs for filling pools
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 <chengzhihao1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent d4c48e5 commit ac085cf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/mtd/ubi/cdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ static long ctrl_cdev_ioctl(struct file *file, unsigned int cmd,
10421042
mutex_lock(&ubi_devices_mutex);
10431043
err = ubi_attach_mtd_dev(mtd, req.ubi_num, req.vid_hdr_offset,
10441044
req.max_beb_per1024, !!req.disable_fm,
1045-
false);
1045+
!!req.need_resv_pool);
10461046
mutex_unlock(&ubi_devices_mutex);
10471047
if (err < 0)
10481048
put_mtd_device(mtd);

include/uapi/mtd/ubi-user.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ enum {
248248
* @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
249249
* @padding: reserved for future, not used, has to be zeroed
250250
* @disable_fm: whether disable fastmap
251+
* @need_resv_pool: whether reserve free pebs for filling pool/wl_pool
251252
*
252253
* This data structure is used to specify MTD device UBI has to attach and the
253254
* parameters it has to use. The number which should be assigned to the new UBI
@@ -293,7 +294,8 @@ struct ubi_attach_req {
293294
__s32 vid_hdr_offset;
294295
__s16 max_beb_per1024;
295296
__s8 disable_fm;
296-
__s8 padding[9];
297+
__s8 need_resv_pool;
298+
__s8 padding[8];
297299
};
298300

299301
/*

0 commit comments

Comments
 (0)