Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef UBI_WL_H
 3#define UBI_WL_H
 4#ifdef CONFIG_MTD_UBI_FASTMAP
 5static void update_fastmap_work_fn(struct work_struct *wrk);
 6static struct ubi_wl_entry *find_anchor_wl_entry(struct rb_root *root);
 7static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
 8static struct ubi_wl_entry *next_peb_for_wl(struct ubi_device *ubi);
 
 9static bool need_wear_leveling(struct ubi_device *ubi);
10static void ubi_fastmap_close(struct ubi_device *ubi);
11static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count)
12{
13	if (ubi->fm_disabled)
14		ubi->fm_pool_rsv_cnt = 0;
15	/* Reserve enough LEBs to store two fastmaps and to fill pools. */
16	*count += (ubi->fm_size / ubi->leb_size) * 2 + ubi->fm_pool_rsv_cnt;
17	INIT_WORK(&ubi->fm_work, update_fastmap_work_fn);
18}
19static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi,
20					       struct ubi_wl_entry *e,
21					       struct rb_root *root);
22#else /* !CONFIG_MTD_UBI_FASTMAP */
23static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
24static inline void ubi_fastmap_close(struct ubi_device *ubi) { }
25static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count) { }
26static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi,
27					       struct ubi_wl_entry *e,
28					       struct rb_root *root) {
29	return e;
30}
31#endif /* CONFIG_MTD_UBI_FASTMAP */
32#endif /* UBI_WL_H */
v6.13.7
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef UBI_WL_H
 3#define UBI_WL_H
 4#ifdef CONFIG_MTD_UBI_FASTMAP
 5static void update_fastmap_work_fn(struct work_struct *wrk);
 6static struct ubi_wl_entry *find_anchor_wl_entry(struct rb_root *root);
 7static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
 8static struct ubi_wl_entry *next_peb_for_wl(struct ubi_device *ubi,
 9					    bool need_fill);
10static bool need_wear_leveling(struct ubi_device *ubi);
11static void ubi_fastmap_close(struct ubi_device *ubi);
12static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count)
13{
14	if (ubi->fm_disabled)
15		ubi->fm_pool_rsv_cnt = 0;
16	/* Reserve enough LEBs to store two fastmaps and to fill pools. */
17	*count += (ubi->fm_size / ubi->leb_size) * 2 + ubi->fm_pool_rsv_cnt;
18	INIT_WORK(&ubi->fm_work, update_fastmap_work_fn);
19}
20static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi,
21					       struct ubi_wl_entry *e,
22					       struct rb_root *root);
23#else /* !CONFIG_MTD_UBI_FASTMAP */
24static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
25static inline void ubi_fastmap_close(struct ubi_device *ubi) { }
26static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count) { }
27static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi,
28					       struct ubi_wl_entry *e,
29					       struct rb_root *root) {
30	return e;
31}
32#endif /* CONFIG_MTD_UBI_FASTMAP */
33#endif /* UBI_WL_H */