Lines Matching +full:one +full:- +full:to +full:- +full:many

1 /* SPDX-License-Identifier: GPL-2.0+ */
13 * This file defines the layout of UBI headers and all the other UBI on-flash
50 * @UBI_VTBL_AUTORESIZE_FLG: auto-resize this volume
52 * %UBI_VTBL_AUTORESIZE_FLG flag can be set only for one volume in the volume
53 * table. UBI automatically re-sizes the volume which has this flag and makes
54 * the volume to be of largest possible size. This means that if after the
56 * present on the device, it automatically appends all of them to the volume
64 * The auto-resize feature is useful for device production purposes. For
68 * exceed certain percent, e.g. 2%. When one creates an UBI image which will be
69 * flashed to the end devices in production, he does not know the exact amount
71 * number is required to calculate the volume sized and put them to the volume
72 * table of the UBI image. In this case, one of the volumes (e.g., the one
73 * which will store the root file system) is marked as "auto-resizable", and
77 * eraseblock handling, and then re-sizes the volume, not vice-versa. This
88 * to the flash
89 * @UBI_COMPAT_RO: attach this device in read-only mode
90 * @UBI_COMPAT_PRESERVE: preserve this internal volume - do not touch its
91 * physical eraseblocks, don't allow the wear-leveling
92 * sub-system to move them
107 #define UBI_EC_HDR_SIZE_CRC (UBI_EC_HDR_SIZE - sizeof(__be32))
108 #define UBI_VID_HDR_SIZE_CRC (UBI_VID_HDR_SIZE - sizeof(__be32))
111 * struct ubi_ec_hdr - UBI erase counter header.
113 * @version: version of UBI implementation which is supposed to accept this
124 * future usage. The unused fields are zeroed. The @version field is used to
125 * indicate the version of UBI implementation which is supposed to be able to
132 * volume identifier header and user data, relative to the beginning of the
133 * physical eraseblock. These values have to be the same for all physical
136 * The @image_seq field is used to validate a UBI image that has been prepared
140 * One way to make use of @image_seq is to increase its value by one every time
148 __be64 ec; /* Warning: the current limit is 31-bit anyway! */
157 * struct ubi_vid_hdr - on-flash UBI volume identifier header.
159 * @version: UBI implementation version which is supposed to accept this UBI
163 * eraseblock (for wear-leveling reasons)
169 * @data_size: how many bytes of data this logical eraseblock contains
171 * @data_pad: how many bytes at the end of this physical eraseblock are not
181 * UBI writes a new VID header to the flash, i.e. when it maps a logical
182 * eraseblock to a new physical eraseblock. The global sequence counter is an
183 * unsigned 64-bit integer and we assume it never overflows. The @sqnum
184 * (sequence number) is used to distinguish between older and newer versions of
187 * There are 2 situations when there may be more than one physical eraseblock
188 * corresponding to the same logical eraseblock, i.e., having the same @vol_id
190 * eraseblock L and it is mapped to the physical eraseblock P.
194 * erasure, then L is written to,i.e. mapped to another physical eraseblock P1,
195 * so P1 is written to, then an unclean reboot happens. Result - there are 2
196 * physical eraseblocks P and P1 corresponding to the same logical eraseblock
200 * 2. From time to time UBI moves logical eraseblocks to other physical
201 * eraseblocks for wear-leveling reasons. If, for example, UBI moves L from P
202 * to P1, and an unclean reboot happens before P is physically erased, there
203 * are two physical eraseblocks P and P1 corresponding to L and UBI has to
204 * select one of them when the flash is attached. The @sqnum field says which
206 * it is not enough to select the physical eraseblock with the higher sequence
208 * copying process, so the data in P is corrupted. It is also not enough to
210 * data there may be old (consider a case if more data was added to P1 after
215 * UBI uses the @copy_flag field to indicate that this logical eraseblock is a
217 * the @data_crc field of the copy (P1). So when UBI needs to pick one physical
218 * eraseblock of two (P or P1), the @copy_flag of the newer one (P1) is
219 * examined. If it is cleared, the situation* is simple and the newer one is
222 * the older one (P) is selected.
226 * UBI purposes. In this implementation there is only one internal volume - the
228 * For example, in future one may introduce a journal internal volume. Internal
233 * provides a mechanism to introduce UBI extensions and to be still compatible
238 * fine. This is similar to what Ext2fs does when it is fed by an Ext3fs image
239 * - it just ignores the Ext3fs journal.
244 * data of the physical eraseblock was moved by the wear-leveling sub-system,
245 * then the wear-leveling sub-system calculates the data CRC and stores it in
248 * The @data_size field is used only for static volumes because UBI has to know
249 * how many bytes of data are stored in this eraseblock. For dynamic volumes,
251 * physical eraseblock was moved to another physical eraseblock for
252 * wear-leveling reasons. In this case, UBI calculates CRC checksum of the
256 * The @used_ebs field is used only for static volumes and indicates how many
262 * eraseblocks of this volume. This is very handy when one uses block-oriented
291 #define UBI_INTERNAL_VOL_START (0x7FFFFFFF - 4096)
302 /* The maximum number of volumes per one UBI device */
312 #define UBI_VTBL_RECORD_SIZE_CRC (UBI_VTBL_RECORD_SIZE - sizeof(__be32))
315 * struct ubi_vtbl_record - a record in the volume table.
316 * @reserved_pebs: how many physical eraseblocks are reserved for this volume
318 * @data_pad: how many bytes are unused at the end of the each physical
319 * eraseblock to satisfy the requested alignment
334 * If the size of the logical eraseblock is large enough to fit
336 * records. Otherwise, it contains as many records as it can fit (i.e., size of
339 * The @upd_marker flag is used to implement volume update. It is set to %1
340 * before update and set to %0 after the update. So if the update operation was
344 * later changed. It may be useful, for example, when a block-oriented file
346 * logical eraseblock size and @alignment. The alignment must be multiple to the
369 /* UBI fastmap on-flash data structures */
374 /* fastmap on-flash data structure format version */
387 /* A fastmap can use up to UBI_FM_MAX_BLOCKS PEBs */
390 /* 5% of the total number of PEBs have to be scanned while attaching
392 * But the size of this pool is limited to be between UBI_FM_MIN_POOL_SIZE and
398 * struct ubi_fm_sb - UBI fastmap super block
421 * struct ubi_fm_hdr - header of the fastmap data set
425 * @scrub_peb_count: number of to be scrubbed PEBs known by this fastmap
427 * @erase_peb_count: number of bad PEBs which have to be erased
444 * struct ubi_fm_scan_pool - Fastmap pool PEBs to be scanned while attaching
461 * struct ubi_fm_ec - stores the erase counter of a PEB
471 * struct ubi_fm_volhdr - Fastmap volume header
491 /* struct ubi_fm_volhdr is followed by one struct ubi_fm_eba records */
494 * struct ubi_fm_eba - denotes an association beween a PEB and LEB