]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - drivers/mtd/ubi/wl.h
UBUNTU: Ubuntu-5.15.0-39.42
[mirror_ubuntu-jammy-kernel.git] / drivers / mtd / ubi / wl.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
78d6d497
RW
2#ifndef UBI_WL_H
3#define UBI_WL_H
4#ifdef CONFIG_MTD_UBI_FASTMAP
78d6d497
RW
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 void ubi_fastmap_close(struct ubi_device *ubi);
acfda79f
RW
9static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count)
10{
11 /* Reserve enough LEBs to store two fastmaps. */
12 *count += (ubi->fm_size / ubi->leb_size) * 2;
13 INIT_WORK(&ubi->fm_work, update_fastmap_work_fn);
14}
2f84c246
RW
15static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi,
16 struct ubi_wl_entry *e,
17 struct rb_root *root);
78d6d497
RW
18#else /* !CONFIG_MTD_UBI_FASTMAP */
19static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
78d6d497 20static inline void ubi_fastmap_close(struct ubi_device *ubi) { }
acfda79f 21static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count) { }
2f84c246
RW
22static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi,
23 struct ubi_wl_entry *e,
24 struct rb_root *root) {
25 return e;
26}
78d6d497
RW
27#endif /* CONFIG_MTD_UBI_FASTMAP */
28#endif /* UBI_WL_H */