Lines Matching refs:ubi
22 int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf, in ubi_calc_data_len() argument
27 ubi_assert(!(length & (ubi->min_io_size - 1))); in ubi_calc_data_len()
34 length = ALIGN(i + 1, ubi->min_io_size); in ubi_calc_data_len()
48 int ubi_check_volume(struct ubi_device *ubi, int vol_id) in ubi_check_volume() argument
52 struct ubi_volume *vol = ubi->volumes[vol_id]; in ubi_check_volume()
71 err = ubi_eba_read_leb(ubi, vol, i, buf, 0, size, 1); in ubi_check_volume()
92 void ubi_update_reserved(struct ubi_device *ubi) in ubi_update_reserved() argument
94 int need = ubi->beb_rsvd_level - ubi->beb_rsvd_pebs; in ubi_update_reserved()
96 if (need <= 0 || ubi->avail_pebs == 0) in ubi_update_reserved()
99 need = min_t(int, need, ubi->avail_pebs); in ubi_update_reserved()
100 ubi->avail_pebs -= need; in ubi_update_reserved()
101 ubi->rsvd_pebs += need; in ubi_update_reserved()
102 ubi->beb_rsvd_pebs += need; in ubi_update_reserved()
103 ubi_msg(ubi, "reserved more %d PEBs for bad PEB handling", need); in ubi_update_reserved()
111 void ubi_calculate_reserved(struct ubi_device *ubi) in ubi_calculate_reserved() argument
117 ubi->beb_rsvd_level = ubi->bad_peb_limit - ubi->bad_peb_count; in ubi_calculate_reserved()
118 if (ubi->beb_rsvd_level < 0) { in ubi_calculate_reserved()
119 ubi->beb_rsvd_level = 0; in ubi_calculate_reserved()
120 …ubi_warn(ubi, "number of bad PEBs (%d) is above the expected limit (%d), not reserving any PEBs fo… in ubi_calculate_reserved()
121 ubi->bad_peb_count, ubi->bad_peb_limit); in ubi_calculate_reserved()
145 void ubi_msg(const struct ubi_device *ubi, const char *fmt, ...) in ubi_msg() argument
155 pr_notice(UBI_NAME_STR "%d: %pV\n", ubi->ubi_num, &vaf); in ubi_msg()
161 void ubi_warn(const struct ubi_device *ubi, const char *fmt, ...) in ubi_warn() argument
172 ubi->ubi_num, __builtin_return_address(0), &vaf); in ubi_warn()
178 void ubi_err(const struct ubi_device *ubi, const char *fmt, ...) in ubi_err() argument
189 ubi->ubi_num, __builtin_return_address(0), &vaf); in ubi_err()