Lines Matching refs:reserved_pebs
83 ret = sprintf(buf, "%d\n", vol->reserved_pebs); in vol_attribute_show()
206 vol->reserved_pebs = div_u64(req->bytes + vol->usable_leb_size - 1, in ubi_create_volume()
210 if (vol->reserved_pebs > ubi->avail_pebs) { in ubi_create_volume()
219 ubi->avail_pebs -= vol->reserved_pebs; in ubi_create_volume()
220 ubi->rsvd_pebs += vol->reserved_pebs; in ubi_create_volume()
239 vol->eba_tbl = kmalloc(vol->reserved_pebs * sizeof(int), GFP_KERNEL); in ubi_create_volume()
245 for (i = 0; i < vol->reserved_pebs; i++) in ubi_create_volume()
249 vol->used_ebs = vol->reserved_pebs; in ubi_create_volume()
290 vtbl_rec.reserved_pebs = cpu_to_be32(vol->reserved_pebs); in ubi_create_volume()
332 ubi->rsvd_pebs -= vol->reserved_pebs; in ubi_create_volume()
333 ubi->avail_pebs += vol->reserved_pebs; in ubi_create_volume()
358 int i, err, vol_id = vol->vol_id, reserved_pebs = vol->reserved_pebs; in ubi_remove_volume() local
385 for (i = 0; i < vol->reserved_pebs; i++) { in ubi_remove_volume()
395 ubi->rsvd_pebs -= reserved_pebs; in ubi_remove_volume()
396 ubi->avail_pebs += reserved_pebs; in ubi_remove_volume()
425 int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs) in ubi_resize_volume() argument
437 ubi->ubi_num, vol_id, vol->reserved_pebs, reserved_pebs); in ubi_resize_volume()
440 reserved_pebs < vol->used_ebs) { in ubi_resize_volume()
442 reserved_pebs, vol->used_ebs); in ubi_resize_volume()
447 if (reserved_pebs == vol->reserved_pebs) in ubi_resize_volume()
450 new_mapping = kmalloc(reserved_pebs * sizeof(int), GFP_KERNEL); in ubi_resize_volume()
454 for (i = 0; i < reserved_pebs; i++) in ubi_resize_volume()
466 pebs = reserved_pebs - vol->reserved_pebs; in ubi_resize_volume()
481 for (i = 0; i < vol->reserved_pebs; i++) in ubi_resize_volume()
490 vtbl_rec.reserved_pebs = cpu_to_be32(reserved_pebs); in ubi_resize_volume()
497 err = ubi_eba_unmap_leb(ubi, vol, reserved_pebs + i); in ubi_resize_volume()
505 for (i = 0; i < reserved_pebs; i++) in ubi_resize_volume()
512 vol->reserved_pebs = reserved_pebs; in ubi_resize_volume()
514 vol->used_ebs = reserved_pebs; in ubi_resize_volume()
649 int reserved_pebs, alignment, data_pad, vol_type, name_len, upd_marker; in self_check_volume() local
655 reserved_pebs = be32_to_cpu(ubi->vtbl[vol_id].reserved_pebs); in self_check_volume()
659 if (reserved_pebs) { in self_check_volume()
667 if (vol->reserved_pebs < 0 || vol->alignment < 0 || vol->data_pad < 0 || in self_check_volume()
700 if (vol->reserved_pebs > ubi->good_peb_count) { in self_check_volume()
729 if (vol->used_ebs != vol->reserved_pebs) { in self_check_volume()
742 if (vol->used_ebs < 0 || vol->used_ebs > vol->reserved_pebs) { in self_check_volume()