Lines Matching refs:vol

135 		struct ubi_volume *vol = re->desc->vol;  in ubi_vtbl_rename_volumes()  local
136 struct ubi_vtbl_record *vtbl_rec = &ubi->vtbl[vol->vol_id]; in ubi_vtbl_rename_volumes()
534 struct ubi_volume *vol; local
542 vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL);
543 if (!vol)
546 vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
547 vol->alignment = be32_to_cpu(vtbl[i].alignment);
548 vol->data_pad = be32_to_cpu(vtbl[i].data_pad);
549 vol->upd_marker = vtbl[i].upd_marker;
550 vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ?
552 vol->name_len = be16_to_cpu(vtbl[i].name_len);
553 vol->usable_leb_size = ubi->leb_size - vol->data_pad;
554 memcpy(vol->name, vtbl[i].name, vol->name_len);
555 vol->name[vol->name_len] = '\0';
556 vol->vol_id = i;
563 kfree(vol);
571 ubi->volumes[i] = vol;
573 vol->ubi = ubi;
574 reserved_pebs += vol->reserved_pebs;
580 if (vol->vol_type == UBI_DYNAMIC_VOLUME) {
581 vol->used_ebs = vol->reserved_pebs;
582 vol->last_eb_bytes = vol->usable_leb_size;
583 vol->used_bytes =
584 (long long)vol->used_ebs * vol->usable_leb_size;
609 vol->corrupted = 1;
613 vol->used_ebs = av->used_ebs;
614 vol->used_bytes =
615 (long long)(vol->used_ebs - 1) * vol->usable_leb_size;
616 vol->used_bytes += av->last_data_size;
617 vol->last_eb_bytes = av->last_data_size;
621 vol = kzalloc(sizeof(struct ubi_volume), GFP_KERNEL);
622 if (!vol)
625 vol->reserved_pebs = UBI_LAYOUT_VOLUME_EBS;
626 vol->alignment = UBI_LAYOUT_VOLUME_ALIGN;
627 vol->vol_type = UBI_DYNAMIC_VOLUME;
628 vol->name_len = sizeof(UBI_LAYOUT_VOLUME_NAME) - 1;
629 memcpy(vol->name, UBI_LAYOUT_VOLUME_NAME, vol->name_len + 1);
630 vol->usable_leb_size = ubi->leb_size;
631 vol->used_ebs = vol->reserved_pebs;
632 vol->last_eb_bytes = vol->reserved_pebs;
633 vol->used_bytes =
634 (long long)vol->used_ebs * (ubi->leb_size - vol->data_pad);
635 vol->vol_id = UBI_LAYOUT_VOLUME_ID;
636 vol->ref_count = 1;
639 ubi->volumes[vol_id2idx(ubi, vol->vol_id)] = vol;
640 reserved_pebs += vol->reserved_pebs;
642 vol->ubi = ubi;
665 static int check_av(const struct ubi_volume *vol, argument
670 if (av->highest_lnum >= vol->reserved_pebs) {
674 if (av->leb_count > vol->reserved_pebs) {
678 if (av->vol_type != vol->vol_type) {
682 if (av->used_ebs > vol->reserved_pebs) {
686 if (av->data_pad != vol->data_pad) {
693 ubi_err(vol->ubi, "bad attaching information, error %d", err);
695 ubi_dump_vol_info(vol);
714 struct ubi_volume *vol; local
733 vol = ubi->volumes[i];
734 if (!vol) {
740 if (vol->reserved_pebs == 0) {
756 err = check_av(vol, av);