Lines Matching refs:vtbl
102 memcpy(&ubi->vtbl[idx], vtbl_rec, sizeof(struct ubi_vtbl_record));
108 err = ubi_eba_write_leb(ubi, layout_vol, i, ubi->vtbl, 0,
137 struct ubi_vtbl_record *vtbl_rec = &ubi->vtbl[vol->vol_id];
160 err = ubi_eba_write_leb(ubi, layout_vol, i, ubi->vtbl, 0,
172 * @vtbl: volume table
174 * This function returns zero if @vtbl is all right, %1 if CRC is incorrect,
178 const struct ubi_vtbl_record *vtbl)
188 reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
189 alignment = be32_to_cpu(vtbl[i].alignment);
190 data_pad = be32_to_cpu(vtbl[i].data_pad);
191 upd_marker = vtbl[i].upd_marker;
192 vol_type = vtbl[i].vol_type;
193 name_len = be16_to_cpu(vtbl[i].name_len);
194 name = &vtbl[i].name[0];
196 crc = crc32(UBI_CRC32_INIT, &vtbl[i], UBI_VTBL_RECORD_SIZE_CRC);
197 if (be32_to_cpu(vtbl[i].crc) != crc) {
199 i, crc, be32_to_cpu(vtbl[i].crc));
200 ubi_dbg_dump_vtbl_record(&vtbl[i], i);
205 if (memcmp(&vtbl[i], &empty_vtbl_record,
273 int len1 = be16_to_cpu(vtbl[i].name_len);
274 int len2 = be16_to_cpu(vtbl[n].name_len);
277 !strncmp(vtbl[i].name, vtbl[n].name, len1)) {
279 " \"%s\"", i, n, vtbl[i].name);
280 ubi_dbg_dump_vtbl_record(&vtbl[i], i);
281 ubi_dbg_dump_vtbl_record(&vtbl[n], n);
291 ubi_dbg_dump_vtbl_record(&vtbl[i], i);
300 * @vtbl: contents of the volume table
306 int copy, void *vtbl)
349 err = ubi_io_write_data(ubi, vtbl, new_seb->pnum, 0, ubi->vtbl_size);
517 struct ubi_vtbl_record *vtbl;
519 vtbl = vmalloc(ubi->vtbl_size);
520 if (!vtbl)
522 memset(vtbl, 0, ubi->vtbl_size);
525 memcpy(&vtbl[i], &empty_vtbl_record, UBI_VTBL_RECORD_SIZE);
530 err = create_vtbl(ubi, si, i, vtbl);
532 vfree(vtbl);
537 return vtbl;
544 * @vtbl: volume table
551 const struct ubi_vtbl_record *vtbl)
560 if (be32_to_cpu(vtbl[i].reserved_pebs) == 0)
567 vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
568 vol->alignment = be32_to_cpu(vtbl[i].alignment);
569 vol->data_pad = be32_to_cpu(vtbl[i].data_pad);
570 vol->upd_marker = vtbl[i].upd_marker;
571 vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ?
573 vol->name_len = be16_to_cpu(vtbl[i].name_len);
575 memcpy(vol->name, vtbl[i].name, vol->name_len);
579 if (vtbl[i].flags & UBI_VTBL_AUTORESIZE_FLG) {
812 ubi->vtbl = create_empty_lvol(ubi, si);
813 if (IS_ERR(ubi->vtbl))
814 return PTR_ERR(ubi->vtbl);
827 ubi->vtbl = process_lvol(ubi, si, sv);
828 if (IS_ERR(ubi->vtbl))
829 return PTR_ERR(ubi->vtbl);
838 err = init_volumes(ubi, si, ubi->vtbl);
853 vfree(ubi->vtbl);
869 if (vtbl_check(ubi, ubi->vtbl)) {