Lines Matching refs:ubi
43 void ubi_msg(const struct ubi_device *ubi, const char *fmt, ...);
47 void ubi_warn(const struct ubi_device *ubi, const char *fmt, ...);
51 void ubi_err(const struct ubi_device *ubi, const char *fmt, ...);
341 struct ubi_device *ubi; member
805 int (*func)(struct ubi_device *ubi, struct ubi_work *wrk, int shutdown);
827 int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum,
833 struct ubi_ainf_peb *ubi_early_get_peb(struct ubi_device *ubi,
835 int ubi_attach(struct ubi_device *ubi, int force_scan);
839 int ubi_change_vtbl_record(struct ubi_device *ubi, int idx,
841 int ubi_vtbl_rename_volumes(struct ubi_device *ubi,
843 int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai);
846 int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req);
849 int ubi_rename_volumes(struct ubi_device *ubi, struct list_head *rename_list);
850 int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol);
851 void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol);
854 int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol,
856 int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol,
858 int ubi_start_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
860 int ubi_more_leb_change_data(struct ubi_device *ubi, struct ubi_volume *vol,
864 int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf,
866 int ubi_check_volume(struct ubi_device *ubi, int vol_id);
867 void ubi_update_reserved(struct ubi_device *ubi);
868 void ubi_calculate_reserved(struct ubi_device *ubi);
886 int ubi_eba_unmap_leb(struct ubi_device *ubi, struct ubi_volume *vol,
888 int ubi_eba_read_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
890 int ubi_eba_read_leb_sg(struct ubi_device *ubi, struct ubi_volume *vol,
893 int ubi_eba_write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
895 int ubi_eba_write_leb_st(struct ubi_device *ubi, struct ubi_volume *vol,
897 int ubi_eba_atomic_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
899 int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
901 int ubi_eba_init(struct ubi_device *ubi, struct ubi_attach_info *ai);
902 unsigned long long ubi_next_sqnum(struct ubi_device *ubi);
903 int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap,
907 int ubi_wl_get_peb(struct ubi_device *ubi);
908 int ubi_wl_put_peb(struct ubi_device *ubi, int vol_id, int lnum,
910 int ubi_wl_flush(struct ubi_device *ubi, int vol_id, int lnum);
911 int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum);
912 int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai);
913 void ubi_wl_close(struct ubi_device *ubi);
915 struct ubi_wl_entry *ubi_wl_get_fm_peb(struct ubi_device *ubi, int anchor);
916 int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *used_e,
919 void ubi_refill_pools(struct ubi_device *ubi);
920 int ubi_ensure_anchor_pebs(struct ubi_device *ubi);
921 int ubi_bitflip_check(struct ubi_device *ubi, int pnum, int force_scrub);
924 int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
926 int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
928 int ubi_io_sync_erase(struct ubi_device *ubi, int pnum, int torture);
929 int ubi_io_is_bad(const struct ubi_device *ubi, int pnum);
930 int ubi_io_mark_bad(const struct ubi_device *ubi, int pnum);
931 int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
933 int ubi_io_write_ec_hdr(struct ubi_device *ubi, int pnum,
935 int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
937 int ubi_io_write_vid_hdr(struct ubi_device *ubi, int pnum,
945 void ubi_put_device(struct ubi_device *ubi);
948 int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol,
950 int ubi_notify_all(struct ubi_device *ubi, int ntype,
953 void ubi_free_all_volumes(struct ubi_device *ubi);
954 void ubi_free_internal_volumes(struct ubi_device *ubi);
957 void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di);
958 void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
961 int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb,
966 size_t ubi_calc_fm_size(struct ubi_device *ubi);
967 int ubi_update_fastmap(struct ubi_device *ubi);
968 int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai,
973 static inline int ubi_update_fastmap(struct ubi_device *ubi) { return 0; } in ubi_update_fastmap() argument
1003 #define ubi_for_each_free_peb(ubi, e, tmp_rb) \ argument
1004 ubi_rb_for_each_entry((tmp_rb), (e), &(ubi)->free, u.rb)
1012 #define ubi_for_each_used_peb(ubi, e, tmp_rb) \ argument
1013 ubi_rb_for_each_entry((tmp_rb), (e), &(ubi)->used, u.rb)
1021 #define ubi_for_each_scrub_peb(ubi, e, tmp_rb) \ argument
1022 ubi_rb_for_each_entry((tmp_rb), (e), &(ubi)->scrub, u.rb)
1030 #define ubi_for_each_protected_peb(ubi, i, e) \ argument
1032 list_for_each_entry((e), &(ubi->pq[(i)]), u.list)
1069 static inline void ubi_init_vid_buf(const struct ubi_device *ubi, in ubi_init_vid_buf() argument
1074 memset(buf, 0, ubi->vid_hdr_alsize); in ubi_init_vid_buf()
1077 vidb->hdr = buf + ubi->vid_hdr_shift; in ubi_init_vid_buf()
1086 ubi_alloc_vid_buf(const struct ubi_device *ubi, gfp_t gfp_flags) in ubi_alloc_vid_buf() argument
1095 buf = kmalloc(ubi->vid_hdr_alsize, gfp_flags); in ubi_alloc_vid_buf()
1101 ubi_init_vid_buf(ubi, vidb, buf); in ubi_alloc_vid_buf()
1133 static inline int ubi_io_read_data(const struct ubi_device *ubi, void *buf, in ubi_io_read_data() argument
1137 return ubi_io_read(ubi, buf, pnum, offset + ubi->leb_start, len); in ubi_io_read_data()
1145 static inline int ubi_io_write_data(struct ubi_device *ubi, const void *buf, in ubi_io_write_data() argument
1149 return ubi_io_write(ubi, buf, pnum, offset + ubi->leb_start, len); in ubi_io_write_data()
1156 static inline void ubi_ro_mode(struct ubi_device *ubi) in ubi_ro_mode() argument
1158 if (!ubi->ro_mode) { in ubi_ro_mode()
1159 ubi->ro_mode = 1; in ubi_ro_mode()
1160 ubi_warn(ubi, "switch to read-only mode"); in ubi_ro_mode()
1170 static inline int vol_id2idx(const struct ubi_device *ubi, int vol_id) in vol_id2idx() argument
1173 return vol_id - UBI_INTERNAL_VOL_START + ubi->vtbl_slots; in vol_id2idx()
1183 static inline int idx2vol_id(const struct ubi_device *ubi, int idx) in idx2vol_id() argument
1185 if (idx >= ubi->vtbl_slots) in idx2vol_id()
1186 return idx - ubi->vtbl_slots + UBI_INTERNAL_VOL_START; in idx2vol_id()
1214 static inline struct ubi_wl_entry *ubi_find_fm_block(const struct ubi_device *ubi, in ubi_find_fm_block() argument
1219 if (ubi->fm) { in ubi_find_fm_block()
1220 for (i = 0; i < ubi->fm->used_blocks; i++) { in ubi_find_fm_block()
1221 if (ubi->fm->e[i]->pnum == pnum) in ubi_find_fm_block()
1222 return ubi->fm->e[i]; in ubi_find_fm_block()