aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Genoud <richard.genoud@gmail.com>2012-08-22 11:27:56 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-22 13:20:49 +0300
commit312e784fb06eaafff4cfebe29c74b8d0ecc09167 (patch)
tree70e8354a62c61946d8836d1eef85a8654ea49789 /include
parent3a814dbfbfb44e8f1805592921b4f39fe0391723 (diff)
UBI: sync ubi-user.h with kernel v3.6-rc1
Also remove the eraseblock type support, because kernel commit a65a0eb6d198e058687a9214683bd1c418f20d39 set the dtype parameter as obsolete. Also adjust to some renames: * 'UBI_PROP_DIRECT_WRITE' -> 'UBI_VOL_PROP_DIRECT_WRITE' * 'struct ubi_set_prop_req' -> 'struct ubi_set_vol_prop_req'. * 'UBI_IOCSETPROP' -> 'UBI_IOCSETVOLPROP' Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/mtd/ubi-user.h76
1 files changed, 35 insertions, 41 deletions
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index 296efae..19762d0 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) International Business Machines Corp., 2006
+ * Copyright © International Business Machines Corp., 2006
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -129,7 +129,7 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~
*
* To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
- * used. A pointer to a &struct ubi_set_prop_req object is expected to be
+ * used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be
* passed. The object describes which property should be set, and to which value
* it should be set.
*/
@@ -184,7 +184,8 @@
/* Check if LEB is mapped command */
#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t)
/* Set an UBI volume property */
-#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
+#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \
+ struct ubi_set_vol_prop_req)
/* Maximum MTD device name length supported by UBI */
#define MAX_UBI_MTD_NAME_LEN 127
@@ -193,23 +194,6 @@
#define UBI_MAX_RNVOL 32
/*
- * UBI data type hint constants.
- *
- * UBI_LONGTERM: long-term data
- * UBI_SHORTTERM: short-term data
- * UBI_UNKNOWN: data persistence is unknown
- *
- * These constants are used when data is written to UBI volumes in order to
- * help the UBI wear-leveling unit to find more appropriate physical
- * eraseblocks.
- */
-enum {
- UBI_LONGTERM = 1,
- UBI_SHORTTERM = 2,
- UBI_UNKNOWN = 3,
-};
-
-/*
* UBI volume type constants.
*
* @UBI_DYNAMIC_VOLUME: dynamic volume
@@ -221,13 +205,14 @@ enum {
};
/*
- * UBI set property ioctl constants
+ * UBI set volume property ioctl constants.
*
- * @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and
- * erase individual eraseblocks on dynamic volumes
+ * @UBI_VOL_PROP_DIRECT_WRITE: allow (any non-zero value) or disallow (value 0)
+ * user to directly write and erase individual
+ * eraseblocks on dynamic volumes
*/
enum {
- UBI_PROP_DIRECT_WRITE = 1,
+ UBI_VOL_PROP_DIRECT_WRITE = 1,
};
/**
@@ -306,7 +291,7 @@ struct ubi_mkvol_req {
int16_t name_len;
int8_t padding2[4];
char name[UBI_MAX_VOLUME_NAME + 1];
-} __attribute__ ((packed));
+} __attribute__((packed));
/**
* struct ubi_rsvol_req - a data structure used in volume re-size requests.
@@ -322,7 +307,7 @@ struct ubi_mkvol_req {
struct ubi_rsvol_req {
int64_t bytes;
int32_t vol_id;
-} __attribute__ ((packed));
+} __attribute__((packed));
/**
* struct ubi_rnvol_req - volumes re-name request.
@@ -364,47 +349,56 @@ struct ubi_rnvol_req {
int8_t padding2[2];
char name[UBI_MAX_VOLUME_NAME + 1];
} ents[UBI_MAX_RNVOL];
-} __attribute__ ((packed));
+} __attribute__((packed));
/**
* struct ubi_leb_change_req - a data structure used in atomic LEB change
* requests.
* @lnum: logical eraseblock number to change
* @bytes: how many bytes will be written to the logical eraseblock
- * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN)
+ * @dtype: pass "3" for better compatibility with old kernels
* @padding: reserved for future, not used, has to be zeroed
+ *
+ * The @dtype field used to inform UBI about what kind of data will be written
+ * to the LEB: long term (value 1), short term (value 2), unknown (value 3).
+ * UBI tried to pick a PEB with lower erase counter for short term data and a
+ * PEB with higher erase counter for long term data. But this was not really
+ * used because users usually do not know this and could easily mislead UBI. We
+ * removed this feature in May 2012. UBI currently just ignores the @dtype
+ * field. But for better compatibility with older kernels it is recommended to
+ * set @dtype to 3 (unknown).
*/
struct ubi_leb_change_req {
int32_t lnum;
int32_t bytes;
- int8_t dtype;
+ int8_t dtype; /* obsolete, do not use! */
int8_t padding[7];
-} __attribute__ ((packed));
+} __attribute__((packed));
/**
* struct ubi_map_req - a data structure used in map LEB requests.
+ * @dtype: pass "3" for better compatibility with old kernels
* @lnum: logical eraseblock number to unmap
- * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN)
* @padding: reserved for future, not used, has to be zeroed
*/
struct ubi_map_req {
int32_t lnum;
- int8_t dtype;
+ int8_t dtype; /* obsolete, do not use! */
int8_t padding[3];
-} __attribute__ ((packed));
+} __attribute__((packed));
/**
- * struct ubi_set_prop_req - a data structure used to set an ubi volume
- * property.
- * @property: property to set (%UBI_PROP_DIRECT_WRITE)
+ * struct ubi_set_vol_prop_req - a data structure used to set an UBI volume
+ * property.
+ * @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE)
* @padding: reserved for future, not used, has to be zeroed
* @value: value to set
*/
-struct ubi_set_prop_req {
- uint8_t property;
- uint8_t padding[7];
- uint64_t value;
-} __attribute__ ((packed));
+struct ubi_set_vol_prop_req {
+ uint8_t property;
+ uint8_t padding[7];
+ uint64_t value;
+} __attribute__((packed));
#endif /* __UBI_USER_H__ */