Lines Matching refs:ubi
41 static int set_update_marker(struct ubi_device *ubi, struct ubi_volume *vol) in set_update_marker() argument
49 ubi_assert(ubi->vtbl[vol->vol_id].upd_marker); in set_update_marker()
54 vtbl_rec = ubi->vtbl[vol->vol_id]; in set_update_marker()
57 mutex_lock(&ubi->device_mutex); in set_update_marker()
58 err = ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); in set_update_marker()
60 mutex_unlock(&ubi->device_mutex); in set_update_marker()
74 static int clear_update_marker(struct ubi_device *ubi, struct ubi_volume *vol, in clear_update_marker() argument
82 vtbl_rec = ubi->vtbl[vol->vol_id]; in clear_update_marker()
97 mutex_lock(&ubi->device_mutex); in clear_update_marker()
98 err = ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); in clear_update_marker()
100 mutex_unlock(&ubi->device_mutex); in clear_update_marker()
114 int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol, in ubi_start_update() argument
123 vol->upd_buf = vmalloc(ubi->leb_size); in ubi_start_update()
127 err = set_update_marker(ubi, vol); in ubi_start_update()
133 err = ubi_eba_unmap_leb(ubi, vol, i); in ubi_start_update()
138 err = ubi_wl_flush(ubi, UBI_ALL, UBI_ALL); in ubi_start_update()
143 err = clear_update_marker(ubi, vol, 0); in ubi_start_update()
168 int ubi_start_leb_change(struct ubi_device *ubi, struct ubi_volume *vol, in ubi_start_leb_change() argument
176 return ubi_eba_atomic_leb_change(ubi, vol, req->lnum, NULL, 0); in ubi_start_leb_change()
183 vol->upd_buf = vmalloc(ALIGN((int)req->bytes, ubi->min_io_size)); in ubi_start_leb_change()
219 static int write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum, in write_leb() argument
225 int l = ALIGN(len, ubi->min_io_size); in write_leb()
228 len = ubi_calc_data_len(ubi, buf, l); in write_leb()
234 err = ubi_eba_write_leb(ubi, vol, lnum, buf, 0, len); in write_leb()
246 err = ubi_eba_write_leb_st(ubi, vol, lnum, buf, len, used_ebs); in write_leb()
265 int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol, in ubi_more_update_data() argument
273 if (ubi->ro_mode) in ubi_more_update_data()
309 err = write_leb(ubi, vol, lnum, vol->upd_buf, flush_len, in ubi_more_update_data()
337 err = write_leb(ubi, vol, lnum, vol->upd_buf, in ubi_more_update_data()
351 err = ubi_wl_flush(ubi, UBI_ALL, UBI_ALL); in ubi_more_update_data()
355 err = clear_update_marker(ubi, vol, vol->upd_bytes); in ubi_more_update_data()
380 int ubi_more_leb_change_data(struct ubi_device *ubi, struct ubi_volume *vol, in ubi_more_leb_change_data() argument
388 if (ubi->ro_mode) in ubi_more_leb_change_data()
401 int len = ALIGN((int)vol->upd_bytes, ubi->min_io_size); in ubi_more_leb_change_data()
405 len = ubi_calc_data_len(ubi, vol->upd_buf, len); in ubi_more_leb_change_data()
406 err = ubi_eba_atomic_leb_change(ubi, vol, vol->ch_lnum, in ubi_more_leb_change_data()