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()
539 struct ubi_volume *vol; in init_volumes() local
547 vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); in init_volumes()
548 if (!vol) in init_volumes()
551 vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs); in init_volumes()
552 vol->alignment = be32_to_cpu(vtbl[i].alignment); in init_volumes()
553 vol->data_pad = be32_to_cpu(vtbl[i].data_pad); in init_volumes()
554 vol->upd_marker = vtbl[i].upd_marker; in init_volumes()
555 vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ? in init_volumes()
557 vol->name_len = be16_to_cpu(vtbl[i].name_len); in init_volumes()
558 vol->usable_leb_size = ubi->leb_size - vol->data_pad; in init_volumes()
559 memcpy(vol->name, vtbl[i].name, vol->name_len); in init_volumes()
560 vol->name[vol->name_len] = '\0'; in init_volumes()
561 vol->vol_id = i; in init_volumes()
564 vol->skip_check = 1; in init_volumes()
571 kfree(vol); in init_volumes()
579 ubi->volumes[i] = vol; in init_volumes()
581 vol->ubi = ubi; in init_volumes()
582 reserved_pebs += vol->reserved_pebs; in init_volumes()
590 err = ubi_fastmap_init_checkmap(vol, ubi->peb_count); in init_volumes()
598 if (vol->vol_type == UBI_DYNAMIC_VOLUME) { in init_volumes()
599 vol->used_ebs = vol->reserved_pebs; in init_volumes()
600 vol->last_eb_bytes = vol->usable_leb_size; in init_volumes()
601 vol->used_bytes = in init_volumes()
602 (long long)vol->used_ebs * vol->usable_leb_size; in init_volumes()
627 vol->corrupted = 1; in init_volumes()
631 vol->used_ebs = av->used_ebs; in init_volumes()
632 vol->used_bytes = in init_volumes()
633 (long long)(vol->used_ebs - 1) * vol->usable_leb_size; in init_volumes()
634 vol->used_bytes += av->last_data_size; in init_volumes()
635 vol->last_eb_bytes = av->last_data_size; in init_volumes()
639 vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); in init_volumes()
640 if (!vol) in init_volumes()
643 vol->reserved_pebs = UBI_LAYOUT_VOLUME_EBS; in init_volumes()
644 vol->alignment = UBI_LAYOUT_VOLUME_ALIGN; in init_volumes()
645 vol->vol_type = UBI_DYNAMIC_VOLUME; in init_volumes()
646 vol->name_len = sizeof(UBI_LAYOUT_VOLUME_NAME) - 1; in init_volumes()
647 memcpy(vol->name, UBI_LAYOUT_VOLUME_NAME, vol->name_len + 1); in init_volumes()
648 vol->usable_leb_size = ubi->leb_size; in init_volumes()
649 vol->used_ebs = vol->reserved_pebs; in init_volumes()
650 vol->last_eb_bytes = vol->reserved_pebs; in init_volumes()
651 vol->used_bytes = in init_volumes()
652 (long long)vol->used_ebs * (ubi->leb_size - vol->data_pad); in init_volumes()
653 vol->vol_id = UBI_LAYOUT_VOLUME_ID; in init_volumes()
654 vol->ref_count = 1; in init_volumes()
657 ubi->volumes[vol_id2idx(ubi, vol->vol_id)] = vol; in init_volumes()
658 reserved_pebs += vol->reserved_pebs; in init_volumes()
660 vol->ubi = ubi; in init_volumes()
661 err = ubi_fastmap_init_checkmap(vol, UBI_LAYOUT_VOLUME_EBS); in init_volumes()
687 static int check_av(const struct ubi_volume *vol, in check_av() argument
692 if (av->highest_lnum >= vol->reserved_pebs) { in check_av()
696 if (av->leb_count > vol->reserved_pebs) { in check_av()
700 if (av->vol_type != vol->vol_type) { in check_av()
704 if (av->used_ebs > vol->reserved_pebs) { in check_av()
708 if (av->data_pad != vol->data_pad) { in check_av()
715 ubi_err(vol->ubi, "bad attaching information, error %d", err); in check_av()
717 ubi_dump_vol_info(vol); in check_av()
736 struct ubi_volume *vol; in check_attaching_info() local
755 vol = ubi->volumes[i]; in check_attaching_info()
756 if (!vol) { in check_attaching_info()
762 if (vol->reserved_pebs == 0) { in check_attaching_info()
778 err = check_av(vol, av); in check_attaching_info()