Lines Matching full:volume
10 * This file includes volume table manipulation code. The volume table is an
11 * on-flash table containing volume meta-data like name, number of reserved
12 * physical eraseblocks, type, etc. The volume table is stored in the so-called
13 * "layout volume".
15 * The layout volume is an internal volume which is organized as follows. It
17 * eraseblock stores one volume table copy, i.e. LEB 0 and LEB 1 duplicate each
18 * other. This redundancy guarantees robustness to unclean reboots. The volume
19 * table is basically an array of volume table records. Each record contains
20 * full information about the volume and protected by a CRC checksum. Note,
21 * nowadays we use the atomic LEB change operation when updating the volume
25 * When the volume table is changed, it is first changed in RAM. Then LEB 0 is
26 * erased, and the updated volume table is written back to LEB 0. Then same for
29 * In this UBI implementation the on-flash volume table does not contain any
32 * But it would still be beneficial to store this information in the volume
33 * table. For example, suppose we have a static volume X, and all its physical
36 * corresponding to the volume X. According to the volume table volume X does
40 * The volume table also stores so-called "update marker", which is used for
41 * volume updates. Before updating the volume, the update marker is set, and
44 * update marker is still there and we know that the volume's contents is
56 /* Empty volume table record */
80 * ubi_change_vtbl_record - change volume table record.
83 * @vtbl_rec: new volume table record
85 * This function changes volume table record @idx. If @vtbl_rec is %NULL, empty
86 * volume table record is written. The caller does not have to calculate CRC of
113 * ubi_vtbl_rename_volumes - rename UBI volumes in the volume table.
117 * This function re-names multiple volumes specified in @req in the volume
150 * vtbl_check - check if volume table is not corrupted and sensible.
152 * @vtbl: volume table
270 ubi_err(ubi, "volume table check failed: record %d, error %d", i, err); in vtbl_check()
276 * create_vtbl - create a copy of volume table.
279 * @copy: number of the volume table copy
280 * @vtbl: contents of the volume table
293 dbg_gen("create volume table (copy #%d)", copy + 1); in create_vtbl()
321 /* Write the layout volume contents */ in create_vtbl()
352 * process_lvol - process the layout volume.
355 * @av: layout volume attaching information
357 * This function is responsible for reading the layout volume, ensuring it is
358 * not corrupted, and recovering from corruptions if needed. Returns volume
373 * volume: in process_lvol()
396 dbg_gen("check layout volume"); in process_lvol()
437 ubi_warn(ubi, "volume table copy #2 is corrupted"); in process_lvol()
441 ubi_msg(ubi, "volume table was restored"); in process_lvol()
456 ubi_err(ubi, "both volume tables are corrupted"); in process_lvol()
460 ubi_warn(ubi, "volume table copy #1 is corrupted"); in process_lvol()
464 ubi_msg(ubi, "volume table was restored"); in process_lvol()
477 * create_empty_lvol - create empty layout volume.
481 * This function returns volume table contents in case of success and a
511 * init_volumes - initialize volume information for existing volumes.
514 * @vtbl: volume table
516 * This function allocates volume description objects for existing volumes.
554 /* Auto re-size flag may be set only for one volume */ in init_volumes()
556 ubi_err(ubi, "more than one auto-resize volume (%d and %d)", in init_volumes()
574 * resize/check the bitmap upon volume resize too. in init_volumes()
582 * In case of dynamic volume UBI knows nothing about how many in init_volumes()
583 * data is stored there. So assume the whole volume is used. in init_volumes()
597 * No eraseblocks belonging to this volume found. We in init_volumes()
598 * don't actually know whether this static volume is in init_volumes()
601 * stored on flash. So we just assume the volume is in init_volumes()
609 * We found a static volume which misses several in init_volumes()
612 ubi_warn(ubi, "static volume %d misses %d LEBs - corrupted", in init_volumes()
625 /* And add the layout volume */ in init_volumes()
667 * check_av - check volume attaching information.
668 * @vol: UBI volume description object
669 * @av: volume attaching information
671 * This function returns zero if the volume attaching information is consistent
672 * to the data read from the volume tabla, and %-EINVAL if not.
715 * the information read from the volume table. Returns zero if the attaching
733 ubi_err(ubi, "too large volume ID %d found", in check_attaching_info()
756 * During attaching we found a volume which does not in check_attaching_info()
757 * exist according to the information in the volume in check_attaching_info()
759 * reboot while the volume was being removed. Discard in check_attaching_info()
762 ubi_msg(ubi, "finish volume %d removal", av->vol_id); in check_attaching_info()
775 * ubi_read_volume_table - read the volume table.
779 * This function reads volume table, checks it, recover from errors if needed,
796 ubi_err(ubi, "LEB size too small for a volume record"); in ubi_read_volume_table()
810 * No logical eraseblocks belonging to the layout volume were in ubi_read_volume_table()
812 * this case we create empty layout volume. in ubi_read_volume_table()
822 ubi_err(ubi, "the layout volume was not found"); in ubi_read_volume_table()
828 ubi_err(ubi, "too many LEBs (%d) in layout volume", in ubi_read_volume_table()
841 * The layout volume is OK, initialize the corresponding in-RAM data in ubi_read_volume_table()
850 * information stored in the volume table. in ubi_read_volume_table()
865 * self_vtbl_check - check volume table.