Lines Matching refs:ubi

49 static int set_update_marker(struct ubi_device *ubi, struct ubi_volume *vol)  in set_update_marker()  argument
57 ubi_assert(ubi->vtbl[vol->vol_id].upd_marker); in set_update_marker()
62 vtbl_rec = ubi->vtbl[vol->vol_id]; in set_update_marker()
65 mutex_lock(&ubi->device_mutex); in set_update_marker()
66 err = ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); in set_update_marker()
68 mutex_unlock(&ubi->device_mutex); in set_update_marker()
82 static int clear_update_marker(struct ubi_device *ubi, struct ubi_volume *vol, in clear_update_marker() argument
90 vtbl_rec = ubi->vtbl[vol->vol_id]; in clear_update_marker()
105 mutex_lock(&ubi->device_mutex); in clear_update_marker()
106 err = ubi_change_vtbl_record(ubi, vol->vol_id, &vtbl_rec); in clear_update_marker()
108 mutex_unlock(&ubi->device_mutex); in clear_update_marker()
122 int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol, in ubi_start_update() argument
131 vol->upd_buf = vmalloc(ubi->leb_size); in ubi_start_update()
135 err = set_update_marker(ubi, vol); in ubi_start_update()
141 err = ubi_eba_unmap_leb(ubi, vol, i); in ubi_start_update()
147 err = ubi_wl_flush(ubi, UBI_ALL, UBI_ALL); in ubi_start_update()
151 err = clear_update_marker(ubi, vol, 0); in ubi_start_update()
176 int ubi_start_leb_change(struct ubi_device *ubi, struct ubi_volume *vol, in ubi_start_leb_change() argument
184 return ubi_eba_atomic_leb_change(ubi, vol, req->lnum, NULL, 0); in ubi_start_leb_change()
227 static int write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum, in write_leb() argument
233 int l = ALIGN(len, ubi->min_io_size); in write_leb()
236 len = ubi_calc_data_len(ubi, buf, l); in write_leb()
242 err = ubi_eba_write_leb(ubi, vol, lnum, buf, 0, len); in write_leb()
254 err = ubi_eba_write_leb_st(ubi, vol, lnum, buf, len, used_ebs); in write_leb()
273 int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol, in ubi_more_update_data() argument
286 if (ubi->ro_mode) in ubi_more_update_data()
322 err = write_leb(ubi, vol, lnum, vol->upd_buf, flush_len, in ubi_more_update_data()
350 err = write_leb(ubi, vol, lnum, vol->upd_buf, in ubi_more_update_data()
364 err = ubi_wl_flush(ubi, UBI_ALL, UBI_ALL); in ubi_more_update_data()
368 err = clear_update_marker(ubi, vol, vol->upd_bytes); in ubi_more_update_data()
393 int ubi_more_leb_change_data(struct ubi_device *ubi, struct ubi_volume *vol, in ubi_more_leb_change_data() argument
401 if (ubi->ro_mode) in ubi_more_leb_change_data()
414 int len = ALIGN((int)vol->upd_bytes, ubi->min_io_size); in ubi_more_leb_change_data()
418 len = ubi_calc_data_len(ubi, vol->upd_buf, len); in ubi_more_leb_change_data()
419 err = ubi_eba_atomic_leb_change(ubi, vol, vol->ch_lnum, in ubi_more_leb_change_data()