Lines Matching refs:vol

141 		struct ubi_volume *vol = re->desc->vol;  in ubi_vtbl_rename_volumes()  local
142 struct ubi_vtbl_record *vtbl_rec = &ubi->vtbl[vol->vol_id]; in ubi_vtbl_rename_volumes()
536 struct ubi_volume *vol; in init_volumes() local
544 vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); in init_volumes()
545 if (!vol) in init_volumes()
548 vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs); in init_volumes()
549 vol->alignment = be32_to_cpu(vtbl[i].alignment); in init_volumes()
550 vol->data_pad = be32_to_cpu(vtbl[i].data_pad); in init_volumes()
551 vol->upd_marker = vtbl[i].upd_marker; in init_volumes()
552 vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ? in init_volumes()
554 vol->name_len = be16_to_cpu(vtbl[i].name_len); in init_volumes()
555 vol->usable_leb_size = ubi->leb_size - vol->data_pad; in init_volumes()
556 memcpy(vol->name, vtbl[i].name, vol->name_len); in init_volumes()
557 vol->name[vol->name_len] = '\0'; in init_volumes()
558 vol->vol_id = i; in init_volumes()
565 kfree(vol); in init_volumes()
573 ubi->volumes[i] = vol; in init_volumes()
575 vol->ubi = ubi; in init_volumes()
576 reserved_pebs += vol->reserved_pebs; in init_volumes()
582 if (vol->vol_type == UBI_DYNAMIC_VOLUME) { in init_volumes()
583 vol->used_ebs = vol->reserved_pebs; in init_volumes()
584 vol->last_eb_bytes = vol->usable_leb_size; in init_volumes()
585 vol->used_bytes = in init_volumes()
586 (long long)vol->used_ebs * vol->usable_leb_size; in init_volumes()
611 vol->corrupted = 1; in init_volumes()
615 vol->used_ebs = av->used_ebs; in init_volumes()
616 vol->used_bytes = in init_volumes()
617 (long long)(vol->used_ebs - 1) * vol->usable_leb_size; in init_volumes()
618 vol->used_bytes += av->last_data_size; in init_volumes()
619 vol->last_eb_bytes = av->last_data_size; in init_volumes()
623 vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); in init_volumes()
624 if (!vol) in init_volumes()
627 vol->reserved_pebs = UBI_LAYOUT_VOLUME_EBS; in init_volumes()
628 vol->alignment = UBI_LAYOUT_VOLUME_ALIGN; in init_volumes()
629 vol->vol_type = UBI_DYNAMIC_VOLUME; in init_volumes()
630 vol->name_len = sizeof(UBI_LAYOUT_VOLUME_NAME) - 1; in init_volumes()
631 memcpy(vol->name, UBI_LAYOUT_VOLUME_NAME, vol->name_len + 1); in init_volumes()
632 vol->usable_leb_size = ubi->leb_size; in init_volumes()
633 vol->used_ebs = vol->reserved_pebs; in init_volumes()
634 vol->last_eb_bytes = vol->reserved_pebs; in init_volumes()
635 vol->used_bytes = in init_volumes()
636 (long long)vol->used_ebs * (ubi->leb_size - vol->data_pad); in init_volumes()
637 vol->vol_id = UBI_LAYOUT_VOLUME_ID; in init_volumes()
638 vol->ref_count = 1; in init_volumes()
641 ubi->volumes[vol_id2idx(ubi, vol->vol_id)] = vol; in init_volumes()
642 reserved_pebs += vol->reserved_pebs; in init_volumes()
644 vol->ubi = ubi; in init_volumes()
668 static int check_av(const struct ubi_volume *vol, in check_av() argument
673 if (av->highest_lnum >= vol->reserved_pebs) { in check_av()
677 if (av->leb_count > vol->reserved_pebs) { in check_av()
681 if (av->vol_type != vol->vol_type) { in check_av()
685 if (av->used_ebs > vol->reserved_pebs) { in check_av()
689 if (av->data_pad != vol->data_pad) { in check_av()
696 ubi_err(vol->ubi, "bad attaching information, error %d", err); in check_av()
698 ubi_dump_vol_info(vol); in check_av()
717 struct ubi_volume *vol; in check_attaching_info() local
736 vol = ubi->volumes[i]; in check_attaching_info()
737 if (!vol) { in check_attaching_info()
743 if (vol->reserved_pebs == 0) { in check_attaching_info()
759 err = check_av(vol, av); in check_attaching_info()