diff options
Diffstat (limited to 'include/mtd/ubi-user.h')
| -rw-r--r-- | include/mtd/ubi-user.h | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h index 3c4109777aff..8787349fbafe 100644 --- a/include/mtd/ubi-user.h +++ b/include/mtd/ubi-user.h | |||
| @@ -196,23 +196,6 @@ | |||
| 196 | #define UBI_MAX_RNVOL 32 | 196 | #define UBI_MAX_RNVOL 32 |
| 197 | 197 | ||
| 198 | /* | 198 | /* |
| 199 | * UBI data type hint constants. | ||
| 200 | * | ||
| 201 | * UBI_LONGTERM: long-term data | ||
| 202 | * UBI_SHORTTERM: short-term data | ||
| 203 | * UBI_UNKNOWN: data persistence is unknown | ||
| 204 | * | ||
| 205 | * These constants are used when data is written to UBI volumes in order to | ||
| 206 | * help the UBI wear-leveling unit to find more appropriate physical | ||
| 207 | * eraseblocks. | ||
| 208 | */ | ||
| 209 | enum { | ||
| 210 | UBI_LONGTERM = 1, | ||
| 211 | UBI_SHORTTERM = 2, | ||
| 212 | UBI_UNKNOWN = 3, | ||
| 213 | }; | ||
| 214 | |||
| 215 | /* | ||
| 216 | * UBI volume type constants. | 199 | * UBI volume type constants. |
| 217 | * | 200 | * |
| 218 | * @UBI_DYNAMIC_VOLUME: dynamic volume | 201 | * @UBI_DYNAMIC_VOLUME: dynamic volume |
| @@ -375,25 +358,34 @@ struct ubi_rnvol_req { | |||
| 375 | * requests. | 358 | * requests. |
| 376 | * @lnum: logical eraseblock number to change | 359 | * @lnum: logical eraseblock number to change |
| 377 | * @bytes: how many bytes will be written to the logical eraseblock | 360 | * @bytes: how many bytes will be written to the logical eraseblock |
| 378 | * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN) | 361 | * @dtype: pass "3" for better compatibility with old kernels |
| 379 | * @padding: reserved for future, not used, has to be zeroed | 362 | * @padding: reserved for future, not used, has to be zeroed |
| 363 | * | ||
| 364 | * The @dtype field used to inform UBI about what kind of data will be written | ||
| 365 | * to the LEB: long term (value 1), short term (value 2), unknown (value 3). | ||
| 366 | * UBI tried to pick a PEB with lower erase counter for short term data and a | ||
| 367 | * PEB with higher erase counter for long term data. But this was not really | ||
| 368 | * used because users usually do not know this and could easily mislead UBI. We | ||
| 369 | * removed this feature in May 2012. UBI currently just ignores the @dtype | ||
| 370 | * field. But for better compatibility with older kernels it is recommended to | ||
| 371 | * set @dtype to 3 (unknown). | ||
| 380 | */ | 372 | */ |
| 381 | struct ubi_leb_change_req { | 373 | struct ubi_leb_change_req { |
| 382 | __s32 lnum; | 374 | __s32 lnum; |
| 383 | __s32 bytes; | 375 | __s32 bytes; |
| 384 | __s8 dtype; | 376 | __s8 dtype; /* obsolete, do not use! */ |
| 385 | __s8 padding[7]; | 377 | __s8 padding[7]; |
| 386 | } __packed; | 378 | } __packed; |
| 387 | 379 | ||
| 388 | /** | 380 | /** |
| 389 | * struct ubi_map_req - a data structure used in map LEB requests. | 381 | * struct ubi_map_req - a data structure used in map LEB requests. |
| 382 | * @dtype: pass "3" for better compatibility with old kernels | ||
| 390 | * @lnum: logical eraseblock number to unmap | 383 | * @lnum: logical eraseblock number to unmap |
| 391 | * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN) | ||
| 392 | * @padding: reserved for future, not used, has to be zeroed | 384 | * @padding: reserved for future, not used, has to be zeroed |
| 393 | */ | 385 | */ |
| 394 | struct ubi_map_req { | 386 | struct ubi_map_req { |
| 395 | __s32 lnum; | 387 | __s32 lnum; |
| 396 | __s8 dtype; | 388 | __s8 dtype; /* obsolete, do not use! */ |
| 397 | __s8 padding[3]; | 389 | __s8 padding[3]; |
| 398 | } __packed; | 390 | } __packed; |
| 399 | 391 | ||
