]> git.ipfire.org Git - people/arne_f/kernel.git/blame - drivers/mtd/ubi/wl.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[people/arne_f/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 int anchor_pebs_avalible(struct rb_root *root);
6static void update_fastmap_work_fn(struct work_struct *wrk);
7static struct ubi_wl_entry *find_anchor_wl_entry(struct rb_root *root);
8static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
9static void ubi_fastmap_close(struct ubi_device *ubi);
acfda79f
RW
10static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count)
11{
12 /* Reserve enough LEBs to store two fastmaps. */
13 *count += (ubi->fm_size / ubi->leb_size) * 2;
14 INIT_WORK(&ubi->fm_work, update_fastmap_work_fn);
15}
2f84c246
RW
16static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi,
17 struct ubi_wl_entry *e,
18 struct rb_root *root);
78d6d497
RW
19#else /* !CONFIG_MTD_UBI_FASTMAP */
20static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
78d6d497 21static inline void ubi_fastmap_close(struct ubi_device *ubi) { }
acfda79f 22static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count) { }
2f84c246
RW
23static struct ubi_wl_entry *may_reserve_for_fm(struct ubi_device *ubi,
24 struct ubi_wl_entry *e,
25 struct rb_root *root) {
26 return e;
27}
78d6d497
RW
28#endif /* CONFIG_MTD_UBI_FASTMAP */
29#endif /* UBI_WL_H */