summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs-media.h
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2016-09-29 21:17:15 +0200
committerRichard Weinberger <richard@nod.at>2016-12-12 23:07:38 +0100
commitf1f52d6b029776bef4a60cc30011a81f0420a873 (patch)
tree7d7c6078c20eac59ce2c5ace303caaa55ebc90a1 /fs/ubifs/ubifs-media.h
parent959c2de2b30bd09582392105889f68a96cb94fa4 (diff)
downloadlinux-f1f52d6b029776bef4a60cc30011a81f0420a873.tar.gz
linux-f1f52d6b029776bef4a60cc30011a81f0420a873.tar.bz2
linux-f1f52d6b029776bef4a60cc30011a81f0420a873.zip
ubifs: Introduce new data node field, compr_size
When data of a data node is compressed and encrypted we need to store the size of the compressed data because before encryption we may have to add padding bytes. For the new field we consume the last two padding bytes in struct ubifs_data_node. Two bytes are fine because the data length is at most 4096. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/ubifs-media.h')
-rw-r--r--fs/ubifs/ubifs-media.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ubifs/ubifs-media.h b/fs/ubifs/ubifs-media.h
index aa302b11aec8..e46331dcca4c 100644
--- a/fs/ubifs/ubifs-media.h
+++ b/fs/ubifs/ubifs-media.h
@@ -553,18 +553,16 @@ struct ubifs_dent_node {
* @key: node key
* @size: uncompressed data size in bytes
* @compr_type: compression type (%UBIFS_COMPR_NONE, %UBIFS_COMPR_LZO, etc)
- * @padding: reserved for future, zeroes
+ * @compr_size: compressed data size in bytes, only valid when data is encrypted
* @data: data
*
- * Note, do not forget to amend 'zero_data_node_unused()' function when
- * changing the padding fields.
*/
struct ubifs_data_node {
struct ubifs_ch ch;
__u8 key[UBIFS_MAX_KEY_LEN];
__le32 size;
__le16 compr_type;
- __u8 padding[2]; /* Watch 'zero_data_node_unused()' if changing! */
+ __le16 compr_size;
__u8 data[];
} __packed;