Lines Matching refs:ubi

49 	spin_lock(&vol->ubi->volumes_lock);  in get_exclusive()
53 ubi_err(vol->ubi, "%d users for volume %d", users, vol->vol_id); in get_exclusive()
61 spin_unlock(&vol->ubi->volumes_lock); in get_exclusive()
75 spin_lock(&vol->ubi->volumes_lock); in revoke_exclusive()
87 spin_unlock(&vol->ubi->volumes_lock); in revoke_exclusive()
123 vol->ubi->ubi_num, vol->vol_id, desc->mode); in vol_cdev_release()
126 ubi_warn(vol->ubi, "update of volume %d not finished, volume is damaged", in vol_cdev_release()
133 vol->upd_received, vol->upd_bytes, vol->ubi->ubi_num, in vol_cdev_release()
150 ubi_err(vol->ubi, "updating"); in vol_cdev_llseek()
161 struct ubi_device *ubi = desc->vol->ubi; in vol_cdev_fsync() local
165 err = ubi_sync(ubi->ubi_num); in vol_cdev_fsync()
176 struct ubi_device *ubi = vol->ubi; in vol_cdev_read() local
185 ubi_err(vol->ubi, "updating"); in vol_cdev_read()
189 ubi_err(vol->ubi, "damaged volume, update marker is set"); in vol_cdev_read()
203 tbuf_size = ALIGN(count, ubi->min_io_size); in vol_cdev_read()
217 err = ubi_eba_read_leb(ubi, vol, lnum, tbuf, off, len, 0); in vol_cdev_read()
253 struct ubi_device *ubi = vol->ubi; in vol_cdev_direct_write() local
268 if (off & (ubi->min_io_size - 1)) { in vol_cdev_direct_write()
269 ubi_err(ubi, "unaligned position"); in vol_cdev_direct_write()
277 if (count & (ubi->min_io_size - 1)) { in vol_cdev_direct_write()
278 ubi_err(ubi, "unaligned write length"); in vol_cdev_direct_write()
284 tbuf_size = ALIGN(count, ubi->min_io_size); in vol_cdev_direct_write()
303 err = ubi_eba_write_leb(ubi, vol, lnum, tbuf, off, len); in vol_cdev_direct_write()
329 struct ubi_device *ubi = vol->ubi; in vol_cdev_write() local
335 err = ubi_more_update_data(ubi, vol, buf, count); in vol_cdev_write()
337 err = ubi_more_leb_change_data(ubi, vol, buf, count); in vol_cdev_write()
340 ubi_err(ubi, "cannot accept more %zd bytes of data, error %d", in vol_cdev_write()
361 err = ubi_check_volume(ubi, vol->vol_id); in vol_cdev_write()
366 ubi_warn(ubi, "volume %d on UBI device %d is corrupted", in vol_cdev_write()
367 vol->vol_id, ubi->ubi_num); in vol_cdev_write()
371 ubi_volume_notify(ubi, vol, UBI_VOLUME_UPDATED); in vol_cdev_write()
384 struct ubi_device *ubi = vol->ubi; in vol_cdev_ioctl() local
420 err = ubi_start_update(ubi, vol, bytes); in vol_cdev_ioctl()
422 ubi_volume_notify(ubi, vol, UBI_VOLUME_UPDATED); in vol_cdev_ioctl()
456 err = ubi_start_leb_change(ubi, vol, &req); in vol_cdev_ioctl()
485 err = ubi_eba_unmap_leb(ubi, vol, lnum); in vol_cdev_ioctl()
489 err = ubi_wl_flush(ubi, UBI_ALL, UBI_ALL); in vol_cdev_ioctl()
548 mutex_lock(&ubi->device_mutex); in vol_cdev_ioctl()
550 mutex_unlock(&ubi->device_mutex); in vol_cdev_ioctl()
593 static int verify_mkvol_req(const struct ubi_device *ubi, in verify_mkvol_req() argument
602 if ((req->vol_id < 0 || req->vol_id >= ubi->vtbl_slots) && in verify_mkvol_req()
623 if (req->alignment > ubi->leb_size) in verify_mkvol_req()
626 n = req->alignment & (ubi->min_io_size - 1); in verify_mkvol_req()
645 ubi_err(ubi, "bad volume creation request"); in verify_mkvol_req()
657 static int verify_rsvol_req(const struct ubi_device *ubi, in verify_rsvol_req() argument
663 if (req->vol_id < 0 || req->vol_id >= ubi->vtbl_slots) in verify_rsvol_req()
679 static int rename_volumes(struct ubi_device *ubi, in rename_volumes() argument
695 req->ents[i].vol_id >= ubi->vtbl_slots) in rename_volumes()
711 ubi_err(ubi, "duplicated volume id %d", in rename_volumes()
716 ubi_err(ubi, "duplicated volume name \"%s\"", in rename_volumes()
736 re->desc = ubi_open_volume(ubi->ubi_num, vol_id, UBI_METAONLY); in rename_volumes()
739 ubi_err(ubi, "cannot open volume %d, error %d", in rename_volumes()
790 desc = ubi_open_volume_nm(ubi->ubi_num, re->new_name, in rename_volumes()
799 ubi_err(ubi, "cannot open volume \"%s\", error %d", in rename_volumes()
818 mutex_lock(&ubi->device_mutex); in rename_volumes()
819 err = ubi_rename_volumes(ubi, &rename_list); in rename_volumes()
820 mutex_unlock(&ubi->device_mutex); in rename_volumes()
835 struct ubi_device *ubi; in ubi_cdev_ioctl() local
842 ubi = ubi_get_by_major(imajor(file->f_mapping->host)); in ubi_cdev_ioctl()
843 if (!ubi) in ubi_cdev_ioctl()
859 err = verify_mkvol_req(ubi, &req); in ubi_cdev_ioctl()
863 mutex_lock(&ubi->device_mutex); in ubi_cdev_ioctl()
864 err = ubi_create_volume(ubi, &req); in ubi_cdev_ioctl()
865 mutex_unlock(&ubi->device_mutex); in ubi_cdev_ioctl()
888 desc = ubi_open_volume(ubi->ubi_num, vol_id, UBI_EXCLUSIVE); in ubi_cdev_ioctl()
894 mutex_lock(&ubi->device_mutex); in ubi_cdev_ioctl()
896 mutex_unlock(&ubi->device_mutex); in ubi_cdev_ioctl()
920 err = verify_rsvol_req(ubi, &req); in ubi_cdev_ioctl()
924 desc = ubi_open_volume(ubi->ubi_num, req.vol_id, UBI_EXCLUSIVE); in ubi_cdev_ioctl()
933 mutex_lock(&ubi->device_mutex); in ubi_cdev_ioctl()
935 mutex_unlock(&ubi->device_mutex); in ubi_cdev_ioctl()
959 err = rename_volumes(ubi, req); in ubi_cdev_ioctl()
975 err = ubi_bitflip_check(ubi, pnum, 0); in ubi_cdev_ioctl()
990 err = ubi_bitflip_check(ubi, pnum, 1); in ubi_cdev_ioctl()
999 ubi_put_device(ubi); in ubi_cdev_ioctl()