• Home
  • Raw
  • Download

Lines Matching refs:vol

128 		struct ubi_volume *vol = re->desc->vol;  in ubi_vtbl_rename_volumes()  local
129 struct ubi_vtbl_record *vtbl_rec = &ubi->vtbl[vol->vol_id]; in ubi_vtbl_rename_volumes()
526 struct ubi_volume *vol; in init_volumes() local
534 vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); in init_volumes()
535 if (!vol) in init_volumes()
538 vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs); in init_volumes()
539 vol->alignment = be32_to_cpu(vtbl[i].alignment); in init_volumes()
540 vol->data_pad = be32_to_cpu(vtbl[i].data_pad); in init_volumes()
541 vol->upd_marker = vtbl[i].upd_marker; in init_volumes()
542 vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ? in init_volumes()
544 vol->name_len = be16_to_cpu(vtbl[i].name_len); in init_volumes()
545 vol->usable_leb_size = ubi->leb_size - vol->data_pad; in init_volumes()
546 memcpy(vol->name, vtbl[i].name, vol->name_len); in init_volumes()
547 vol->name[vol->name_len] = '\0'; in init_volumes()
548 vol->vol_id = i; in init_volumes()
551 vol->skip_check = 1; in init_volumes()
558 kfree(vol); in init_volumes()
566 ubi->volumes[i] = vol; in init_volumes()
568 vol->ubi = ubi; in init_volumes()
569 reserved_pebs += vol->reserved_pebs; in init_volumes()
577 err = ubi_fastmap_init_checkmap(vol, ubi->peb_count); in init_volumes()
585 if (vol->vol_type == UBI_DYNAMIC_VOLUME) { in init_volumes()
586 vol->used_ebs = vol->reserved_pebs; in init_volumes()
587 vol->last_eb_bytes = vol->usable_leb_size; in init_volumes()
588 vol->used_bytes = in init_volumes()
589 (long long)vol->used_ebs * vol->usable_leb_size; in init_volumes()
614 vol->corrupted = 1; in init_volumes()
618 vol->used_ebs = av->used_ebs; in init_volumes()
619 vol->used_bytes = in init_volumes()
620 (long long)(vol->used_ebs - 1) * vol->usable_leb_size; in init_volumes()
621 vol->used_bytes += av->last_data_size; in init_volumes()
622 vol->last_eb_bytes = av->last_data_size; in init_volumes()
626 vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL); in init_volumes()
627 if (!vol) in init_volumes()
630 vol->reserved_pebs = UBI_LAYOUT_VOLUME_EBS; in init_volumes()
631 vol->alignment = UBI_LAYOUT_VOLUME_ALIGN; in init_volumes()
632 vol->vol_type = UBI_DYNAMIC_VOLUME; in init_volumes()
633 vol->name_len = sizeof(UBI_LAYOUT_VOLUME_NAME) - 1; in init_volumes()
634 memcpy(vol->name, UBI_LAYOUT_VOLUME_NAME, vol->name_len + 1); in init_volumes()
635 vol->usable_leb_size = ubi->leb_size; in init_volumes()
636 vol->used_ebs = vol->reserved_pebs; in init_volumes()
637 vol->last_eb_bytes = vol->reserved_pebs; in init_volumes()
638 vol->used_bytes = in init_volumes()
639 (long long)vol->used_ebs * (ubi->leb_size - vol->data_pad); in init_volumes()
640 vol->vol_id = UBI_LAYOUT_VOLUME_ID; in init_volumes()
641 vol->ref_count = 1; in init_volumes()
644 ubi->volumes[vol_id2idx(ubi, vol->vol_id)] = vol; in init_volumes()
645 reserved_pebs += vol->reserved_pebs; in init_volumes()
647 vol->ubi = ubi; in init_volumes()
648 err = ubi_fastmap_init_checkmap(vol, UBI_LAYOUT_VOLUME_EBS); in init_volumes()
674 static int check_av(const struct ubi_volume *vol, in check_av() argument
679 if (av->highest_lnum >= vol->reserved_pebs) { in check_av()
683 if (av->leb_count > vol->reserved_pebs) { in check_av()
687 if (av->vol_type != vol->vol_type) { in check_av()
691 if (av->used_ebs > vol->reserved_pebs) { in check_av()
695 if (av->data_pad != vol->data_pad) { in check_av()
702 ubi_err(vol->ubi, "bad attaching information, error %d", err); in check_av()
704 ubi_dump_vol_info(vol); in check_av()
723 struct ubi_volume *vol; in check_attaching_info() local
742 vol = ubi->volumes[i]; in check_attaching_info()
743 if (!vol) { in check_attaching_info()
749 if (vol->reserved_pebs == 0) { in check_attaching_info()
765 err = check_av(vol, av); in check_attaching_info()