Lines Matching +full:many +full:- +full:to +full:- +full:one
4 * SPDX-License-Identifier: GPL-2.0+
14 * This file defines the layout of UBI headers and all the other UBI on-flash
51 * @UBI_VTBL_AUTORESIZE_FLG: auto-resize this volume
53 * %UBI_VTBL_AUTORESIZE_FLG flag can be set only for one volume in the volume
54 * table. UBI automatically re-sizes the volume which has this flag and makes
55 * the volume to be of largest possible size. This means that if after the
57 * present on the device, it automatically appends all of them to the volume
65 * The auto-resize feature is useful for device production purposes. For
69 * exceed certain percent, e.g. 2%. When one creates an UBI image which will be
70 * flashed to the end devices in production, he does not know the exact amount
72 * number is required to calculate the volume sized and put them to the volume
73 * table of the UBI image. In this case, one of the volumes (e.g., the one
74 * which will store the root file system) is marked as "auto-resizable", and
78 * eraseblock handling, and then re-sizes the volume, not vice-versa. This
89 * to the flash
90 * @UBI_COMPAT_RO: attach this device in read-only mode
91 * @UBI_COMPAT_PRESERVE: preserve this internal volume - do not touch its
92 * physical eraseblocks, don't allow the wear-leveling
93 * sub-system to move them
108 #define UBI_EC_HDR_SIZE_CRC (UBI_EC_HDR_SIZE - sizeof(__be32))
109 #define UBI_VID_HDR_SIZE_CRC (UBI_VID_HDR_SIZE - sizeof(__be32))
112 * struct ubi_ec_hdr - UBI erase counter header.
114 * @version: version of UBI implementation which is supposed to accept this
125 * future usage. The unused fields are zeroed. The @version field is used to
126 * indicate the version of UBI implementation which is supposed to be able to
133 * volume identifier header and user data, relative to the beginning of the
134 * physical eraseblock. These values have to be the same for all physical
137 * The @image_seq field is used to validate a UBI image that has been prepared
141 * One way to make use of @image_seq is to increase its value by one every time
149 __be64 ec; /* Warning: the current limit is 31-bit anyway! */
158 * struct ubi_vid_hdr - on-flash UBI volume identifier header.
160 * @version: UBI implementation version which is supposed to accept this UBI
164 * eraseblock (for wear-leveling reasons)
170 * @data_size: how many bytes of data this logical eraseblock contains
172 * @data_pad: how many bytes at the end of this physical eraseblock are not
182 * UBI writes a new VID header to the flash, i.e. when it maps a logical
183 * eraseblock to a new physical eraseblock. The global sequence counter is an
184 * unsigned 64-bit integer and we assume it never overflows. The @sqnum
185 * (sequence number) is used to distinguish between older and newer versions of
188 * There are 2 situations when there may be more than one physical eraseblock
189 * corresponding to the same logical eraseblock, i.e., having the same @vol_id
191 * eraseblock L and it is mapped to the physical eraseblock P.
195 * erasure, then L is written to,i.e. mapped to another physical eraseblock P1,
196 * so P1 is written to, then an unclean reboot happens. Result - there are 2
197 * physical eraseblocks P and P1 corresponding to the same logical eraseblock
201 * 2. From time to time UBI moves logical eraseblocks to other physical
202 * eraseblocks for wear-leveling reasons. If, for example, UBI moves L from P
203 * to P1, and an unclean reboot happens before P is physically erased, there
204 * are two physical eraseblocks P and P1 corresponding to L and UBI has to
205 * select one of them when the flash is attached. The @sqnum field says which
207 * it is not enough to select the physical eraseblock with the higher sequence
209 * copying process, so the data in P is corrupted. It is also not enough to
211 * data there may be old (consider a case if more data was added to P1 after
216 * UBI uses the @copy_flag field to indicate that this logical eraseblock is a
218 * the @data_crc field of the copy (P1). So when UBI needs to pick one physical
219 * eraseblock of two (P or P1), the @copy_flag of the newer one (P1) is
220 * examined. If it is cleared, the situation* is simple and the newer one is
223 * the older one (P) is selected.
227 * UBI purposes. In this implementation there is only one internal volume - the
229 * For example, in future one may introduce a journal internal volume. Internal
234 * provides a mechanism to introduce UBI extensions and to be still compatible
239 * fine. This is similar to what Ext2fs does when it is fed by an Ext3fs image
240 * - it just ignores the Ext3fs journal.
245 * data of the physical eraseblock was moved by the wear-leveling sub-system,
246 * then the wear-leveling sub-system calculates the data CRC and stores it in
249 * The @data_size field is used only for static volumes because UBI has to know
250 * how many bytes of data are stored in this eraseblock. For dynamic volumes,
252 * physical eraseblock was moved to another physical eraseblock for
253 * wear-leveling reasons. In this case, UBI calculates CRC checksum of the
257 * The @used_ebs field is used only for static volumes and indicates how many
263 * eraseblocks of this volume. This is very handy when one uses block-oriented
292 #define UBI_INTERNAL_VOL_START (0x7FFFFFFF - 4096)
303 /* The maximum number of volumes per one UBI device */
313 #define UBI_VTBL_RECORD_SIZE_CRC (UBI_VTBL_RECORD_SIZE - sizeof(__be32))
316 * struct ubi_vtbl_record - a record in the volume table.
317 * @reserved_pebs: how many physical eraseblocks are reserved for this volume
319 * @data_pad: how many bytes are unused at the end of the each physical
320 * eraseblock to satisfy the requested alignment
335 * If the size of the logical eraseblock is large enough to fit
337 * records. Otherwise, it contains as many records as it can fit (i.e., size of
340 * The @upd_marker flag is used to implement volume update. It is set to %1
341 * before update and set to %0 after the update. So if the update operation was
345 * later changed. It may be useful, for example, when a block-oriented file
347 * logical eraseblock size and @alignment. The alignment must be multiple to the
370 /* UBI fastmap on-flash data structures */
375 /* fastmap on-flash data structure format version */
388 /* A fastmap can use up to UBI_FM_MAX_BLOCKS PEBs */
391 /* 5% of the total number of PEBs have to be scanned while attaching
393 * But the size of this pool is limited to be between UBI_FM_MIN_POOL_SIZE and
399 * struct ubi_fm_sb - UBI fastmap super block
422 * struct ubi_fm_hdr - header of the fastmap data set
426 * @scrub_peb_count: number of to be scrubbed PEBs known by this fastmap
428 * @erase_peb_count: number of bad PEBs which have to be erased
445 * struct ubi_fm_scan_pool - Fastmap pool PEBs to be scanned while attaching
462 * struct ubi_fm_ec - stores the erase counter of a PEB
472 * struct ubi_fm_volhdr - Fastmap volume header
492 /* struct ubi_fm_volhdr is followed by one struct ubi_fm_eba records */
495 * struct ubi_fm_eba - denotes an association beween a PEB and LEB