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
803 int (*func)(struct ubi_device *ubi, struct ubi_work *wrk, int shutdown);
825 int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum,
831 struct ubi_ainf_peb *ubi_early_get_peb(struct ubi_device *ubi,
833 int ubi_attach(struct ubi_device *ubi, int force_scan);
837 int ubi_change_vtbl_record(struct ubi_device *ubi, int idx,
839 int ubi_vtbl_rename_volumes(struct ubi_device *ubi,
841 int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai);
844 int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req);
847 int ubi_rename_volumes(struct ubi_device *ubi, struct list_head *rename_list);
848 int ubi_add_volume(struct ubi_device *ubi, struct ubi_volume *vol);
849 void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol);
852 int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol,
854 int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol,
856 int ubi_start_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
858 int ubi_more_leb_change_data(struct ubi_device *ubi, struct ubi_volume *vol,
862 int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf,
864 int ubi_check_volume(struct ubi_device *ubi, int vol_id);
865 void ubi_update_reserved(struct ubi_device *ubi);
866 void ubi_calculate_reserved(struct ubi_device *ubi);
884 int ubi_eba_unmap_leb(struct ubi_device *ubi, struct ubi_volume *vol,
886 int ubi_eba_read_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
888 int ubi_eba_read_leb_sg(struct ubi_device *ubi, struct ubi_volume *vol,
891 int ubi_eba_write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
893 int ubi_eba_write_leb_st(struct ubi_device *ubi, struct ubi_volume *vol,
895 int ubi_eba_atomic_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
897 int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
899 int ubi_eba_init(struct ubi_device *ubi, struct ubi_attach_info *ai);
900 unsigned long long ubi_next_sqnum(struct ubi_device *ubi);
901 int self_check_eba(struct ubi_device *ubi, struct ubi_attach_info *ai_fastmap,
905 int ubi_wl_get_peb(struct ubi_device *ubi);
906 int ubi_wl_put_peb(struct ubi_device *ubi, int vol_id, int lnum,
908 int ubi_wl_flush(struct ubi_device *ubi, int vol_id, int lnum);
909 int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum);
910 int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai);
911 void ubi_wl_close(struct ubi_device *ubi);
913 struct ubi_wl_entry *ubi_wl_get_fm_peb(struct ubi_device *ubi, int anchor);
914 int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *used_e,
917 void ubi_refill_pools(struct ubi_device *ubi);
918 int ubi_ensure_anchor_pebs(struct ubi_device *ubi);
919 int ubi_bitflip_check(struct ubi_device *ubi, int pnum, int force_scrub);
922 int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
924 int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
926 int ubi_io_sync_erase(struct ubi_device *ubi, int pnum, int torture);
927 int ubi_io_is_bad(const struct ubi_device *ubi, int pnum);
928 int ubi_io_mark_bad(const struct ubi_device *ubi, int pnum);
929 int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
931 int ubi_io_write_ec_hdr(struct ubi_device *ubi, int pnum,
933 int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
935 int ubi_io_write_vid_hdr(struct ubi_device *ubi, int pnum,
944 void ubi_put_device(struct ubi_device *ubi);
947 int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol,
949 int ubi_notify_all(struct ubi_device *ubi, int ntype,
952 void ubi_free_all_volumes(struct ubi_device *ubi);
953 void ubi_free_internal_volumes(struct ubi_device *ubi);
956 void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di);
957 void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
960 int ubi_compare_lebs(struct ubi_device *ubi, const struct ubi_ainf_peb *aeb,
965 size_t ubi_calc_fm_size(struct ubi_device *ubi);
966 int ubi_update_fastmap(struct ubi_device *ubi);
967 int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai,
972 static inline int ubi_update_fastmap(struct ubi_device *ubi) { return 0; } in ubi_update_fastmap() argument
1002 #define ubi_for_each_free_peb(ubi, e, tmp_rb) \ argument
1003 ubi_rb_for_each_entry((tmp_rb), (e), &(ubi)->free, u.rb)
1011 #define ubi_for_each_used_peb(ubi, e, tmp_rb) \ argument
1012 ubi_rb_for_each_entry((tmp_rb), (e), &(ubi)->used, u.rb)
1020 #define ubi_for_each_scrub_peb(ubi, e, tmp_rb) \ argument
1021 ubi_rb_for_each_entry((tmp_rb), (e), &(ubi)->scrub, u.rb)
1029 #define ubi_for_each_protected_peb(ubi, i, e) \ argument
1031 list_for_each_entry((e), &(ubi->pq[(i)]), u.list)
1068 static inline void ubi_init_vid_buf(const struct ubi_device *ubi, in ubi_init_vid_buf() argument
1073 memset(buf, 0, ubi->vid_hdr_alsize); in ubi_init_vid_buf()
1076 vidb->hdr = buf + ubi->vid_hdr_shift; in ubi_init_vid_buf()
1085 ubi_alloc_vid_buf(const struct ubi_device *ubi, gfp_t gfp_flags) in ubi_alloc_vid_buf() argument
1094 buf = kmalloc(ubi->vid_hdr_alsize, gfp_flags); in ubi_alloc_vid_buf()
1100 ubi_init_vid_buf(ubi, vidb, buf); in ubi_alloc_vid_buf()
1132 static inline int ubi_io_read_data(const struct ubi_device *ubi, void *buf, in ubi_io_read_data() argument
1136 return ubi_io_read(ubi, buf, pnum, offset + ubi->leb_start, len); in ubi_io_read_data()
1144 static inline int ubi_io_write_data(struct ubi_device *ubi, const void *buf, in ubi_io_write_data() argument
1148 return ubi_io_write(ubi, buf, pnum, offset + ubi->leb_start, len); in ubi_io_write_data()
1155 static inline void ubi_ro_mode(struct ubi_device *ubi) in ubi_ro_mode() argument
1157 if (!ubi->ro_mode) { in ubi_ro_mode()
1158 ubi->ro_mode = 1; in ubi_ro_mode()
1159 ubi_warn(ubi, "switch to read-only mode"); in ubi_ro_mode()
1169 static inline int vol_id2idx(const struct ubi_device *ubi, int vol_id) in vol_id2idx() argument
1172 return vol_id - UBI_INTERNAL_VOL_START + ubi->vtbl_slots; in vol_id2idx()
1182 static inline int idx2vol_id(const struct ubi_device *ubi, int idx) in idx2vol_id() argument
1184 if (idx >= ubi->vtbl_slots) in idx2vol_id()
1185 return idx - ubi->vtbl_slots + UBI_INTERNAL_VOL_START; in idx2vol_id()
1213 static inline struct ubi_wl_entry *ubi_find_fm_block(const struct ubi_device *ubi, in ubi_find_fm_block() argument
1218 if (ubi->fm) { in ubi_find_fm_block()
1219 for (i = 0; i < ubi->fm->used_blocks; i++) { in ubi_find_fm_block()
1220 if (ubi->fm->e[i]->pnum == pnum) in ubi_find_fm_block()
1221 return ubi->fm->e[i]; in ubi_find_fm_block()