ubi-media.h (7a9787e1eba95a166265e6a260cf30af04ef0a99) | ubi-media.h (025dfdafe77f20b3890981a394774baab7b9c827) |
---|---|
1/* 2 * Copyright (c) International Business Machines Corp., 2006 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 121 unchanged lines hidden (view full) --- 130 * @vid_hdr_offset: where the VID header starts 131 * @data_offset: where the user data start 132 * @padding2: reserved for future, zeroes 133 * @hdr_crc: erase counter header CRC checksum 134 * 135 * The erase counter header takes 64 bytes and has a plenty of unused space for 136 * future usage. The unused fields are zeroed. The @version field is used to 137 * indicate the version of UBI implementation which is supposed to be able to | 1/* 2 * Copyright (c) International Business Machines Corp., 2006 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 121 unchanged lines hidden (view full) --- 130 * @vid_hdr_offset: where the VID header starts 131 * @data_offset: where the user data start 132 * @padding2: reserved for future, zeroes 133 * @hdr_crc: erase counter header CRC checksum 134 * 135 * The erase counter header takes 64 bytes and has a plenty of unused space for 136 * future usage. The unused fields are zeroed. The @version field is used to 137 * indicate the version of UBI implementation which is supposed to be able to |
138 * work with this UBI image. If @version is greater then the current UBI | 138 * work with this UBI image. If @version is greater than the current UBI |
139 * version, the image is rejected. This may be useful in future if something 140 * is changed radically. This field is duplicated in the volume identifier 141 * header. 142 * 143 * The @vid_hdr_offset and @data_offset fields contain the offset of the the 144 * volume identifier header and user data, relative to the beginning of the 145 * physical eraseblock. These values have to be the same for all physical 146 * eraseblocks. --- 35 unchanged lines hidden (view full) --- 182 * The @sqnum is the value of the global sequence counter at the time when this 183 * VID header was created. The global sequence counter is incremented each time 184 * UBI writes a new VID header to the flash, i.e. when it maps a logical 185 * eraseblock to a new physical eraseblock. The global sequence counter is an 186 * unsigned 64-bit integer and we assume it never overflows. The @sqnum 187 * (sequence number) is used to distinguish between older and newer versions of 188 * logical eraseblocks. 189 * | 139 * version, the image is rejected. This may be useful in future if something 140 * is changed radically. This field is duplicated in the volume identifier 141 * header. 142 * 143 * The @vid_hdr_offset and @data_offset fields contain the offset of the the 144 * volume identifier header and user data, relative to the beginning of the 145 * physical eraseblock. These values have to be the same for all physical 146 * eraseblocks. --- 35 unchanged lines hidden (view full) --- 182 * The @sqnum is the value of the global sequence counter at the time when this 183 * VID header was created. The global sequence counter is incremented each time 184 * UBI writes a new VID header to the flash, i.e. when it maps a logical 185 * eraseblock to a new physical eraseblock. The global sequence counter is an 186 * unsigned 64-bit integer and we assume it never overflows. The @sqnum 187 * (sequence number) is used to distinguish between older and newer versions of 188 * logical eraseblocks. 189 * |
190 * There are 2 situations when there may be more then one physical eraseblock | 190 * There are 2 situations when there may be more than one physical eraseblock |
191 * corresponding to the same logical eraseblock, i.e., having the same @vol_id 192 * and @lnum values in the volume identifier header. Suppose we have a logical 193 * eraseblock L and it is mapped to the physical eraseblock P. 194 * 195 * 1. Because UBI may erase physical eraseblocks asynchronously, the following 196 * situation is possible: L is asynchronously erased, so P is scheduled for 197 * erasure, then L is written to,i.e. mapped to another physical eraseblock P1, 198 * so P1 is written to, then an unclean reboot happens. Result - there are 2 --- 170 unchanged lines hidden --- | 191 * corresponding to the same logical eraseblock, i.e., having the same @vol_id 192 * and @lnum values in the volume identifier header. Suppose we have a logical 193 * eraseblock L and it is mapped to the physical eraseblock P. 194 * 195 * 1. Because UBI may erase physical eraseblocks asynchronously, the following 196 * situation is possible: L is asynchronously erased, so P is scheduled for 197 * erasure, then L is written to,i.e. mapped to another physical eraseblock P1, 198 * so P1 is written to, then an unclean reboot happens. Result - there are 2 --- 170 unchanged lines hidden --- |