]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/mtd/ubi/wl.h
4046ccf8942b1d3bebbd51710b33b3ec072861f2
[karo-tx-linux.git] / drivers / mtd / ubi / wl.h
1 #ifndef UBI_WL_H
2 #define UBI_WL_H
3 #ifdef CONFIG_MTD_UBI_FASTMAP
4 static int is_fm_block(struct ubi_device *ubi, int pnum);
5 static int anchor_pebs_avalible(struct rb_root *root);
6 static void update_fastmap_work_fn(struct work_struct *wrk);
7 static struct ubi_wl_entry *find_anchor_wl_entry(struct rb_root *root);
8 static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
9 static void ubi_fastmap_close(struct ubi_device *ubi);
10 static 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 }
16 #else /* !CONFIG_MTD_UBI_FASTMAP */
17 static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi);
18 static inline int is_fm_block(struct ubi_device *ubi, int pnum)
19 {
20         return 0;
21 }
22 static inline void ubi_fastmap_close(struct ubi_device *ubi) { }
23 static inline void ubi_fastmap_init(struct ubi_device *ubi, int *count) { }
24 #endif /* CONFIG_MTD_UBI_FASTMAP */
25 #endif /* UBI_WL_H */