• Home
  • Raw
  • Download

Lines Matching refs:ubi

23 int ubi_calc_data_len(const struct ubi_device *ubi, const void *buf,  in ubi_calc_data_len()  argument
28 ubi_assert(!(length & (ubi->min_io_size - 1))); in ubi_calc_data_len()
35 length = ALIGN(i + 1, ubi->min_io_size); in ubi_calc_data_len()
49 int ubi_check_volume(struct ubi_device *ubi, int vol_id) in ubi_check_volume() argument
53 struct ubi_volume *vol = ubi->volumes[vol_id]; in ubi_check_volume()
72 err = ubi_eba_read_leb(ubi, vol, i, buf, 0, size, 1); in ubi_check_volume()
93 void ubi_update_reserved(struct ubi_device *ubi) in ubi_update_reserved() argument
95 int need = ubi->beb_rsvd_level - ubi->beb_rsvd_pebs; in ubi_update_reserved()
97 if (need <= 0 || ubi->avail_pebs == 0) in ubi_update_reserved()
100 need = min_t(int, need, ubi->avail_pebs); in ubi_update_reserved()
101 ubi->avail_pebs -= need; in ubi_update_reserved()
102 ubi->rsvd_pebs += need; in ubi_update_reserved()
103 ubi->beb_rsvd_pebs += need; in ubi_update_reserved()
104 ubi_msg(ubi, "reserved more %d PEBs for bad PEB handling", need); in ubi_update_reserved()
112 void ubi_calculate_reserved(struct ubi_device *ubi) in ubi_calculate_reserved() argument
118 ubi->beb_rsvd_level = ubi->bad_peb_limit - ubi->bad_peb_count; in ubi_calculate_reserved()
119 if (ubi->beb_rsvd_level < 0) { in ubi_calculate_reserved()
120 ubi->beb_rsvd_level = 0; in ubi_calculate_reserved()
121 …ubi_warn(ubi, "number of bad PEBs (%d) is above the expected limit (%d), not reserving any PEBs fo… in ubi_calculate_reserved()
122 ubi->bad_peb_count, ubi->bad_peb_limit); in ubi_calculate_reserved()